Compartilhar via


Initialize RTC (Windows CE 5.0)

Send Feedback

The following code example shows how to create and initialize the RTC client object.

**Note   **This code has not been thoroughly tested, does not contain error checking, and is not intended for production use.

HRESULT hr = S_OK;

// RTC Initialization 
// Use COINIT_MULTITHREADED on Windows CE
::CoInitializeEx(NULL,COINIT_MULTITHREADED);

// Create the RTC Client COM object. 
IRTCClient *pIRTCClient;

hr = CoCreateInstance( CLSID_RTCClient,
                       NULL,
                       CLSCTX_INPROC_SERVER,
                       IID_IRTCClient,
                       reinterpret_cast<void **> (&pIRTCClient) );

// if (hr != S_OK) process error here. 

// Initialize the RTCClient interface. 
hr = pIRTCClient->Initialize();

// if (hr != S_OK) process error here.

See Also

Fundamental RTC Code Examples

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.