CeRapiInitEx

This function attempts to initialize the Microsoft® Windows® CE RAPI and initially returns an event handle.

STDAPI CeRapiInitEx(
  RAPIINIT * pRapiInit 
);

Parameters

  • pRapiInit
    [in] Pointer to a RAPIINIT structure. The cbSize member of this structure contains the size of the structure being passed in. Initially, a handle to an event is passed back in the heRapiInit member of this structure. When the connection is made or an error occurs, the event is set. The hrRapiInit member of this structure contains the value S_OK if the connection is successful, or E_FAIL if an error occurred.

Return Values

S_OK indicates success. E_FAIL indicates failure. E_INVALIDARG indicates that an invalid value was encountered.

Remarks

This function is a part of the RAPI that invokes function calls on a Windows CE–based device. RAPI functions are supported only for applications that run on desktop platforms.

The CeRapiInitEx or CeRapiInit functions must be called before any remote API calls can be performed. They initialize the underlying communications layers between the desktop PC and the target platform device.

Call CeRapiInitEx to avoid blocking a thread inside of a call to CeRapiInit. CeRapiInitEx returns immediately and continues initialization until the connection is made, until an error occurs, or until there is a call to CeRapiUninit. When CeRapiInitEx is complete it then sets the event specified in the heRapiInit member of the RAPIINIT structure.

After calling CeRapiInitEx, check the return value to see if an error occurred. If the call was initially successful, call the MsgWaitForMultipleObjects function to wait on the event handle passed back in the heRapiInit member of the RAPIINIT structure. When the event is set, check the hrRapiInit member of the structure to determine whether the connection was successful.

To shut down or to abort the connection process, call the CeRapiUnInit function.

Requirements

Smartphone Platforms: Smartphone 2002 and later
OS Versions: Windows CE 3.0 and later
Header: rapi.h
Library: rapi.lib

See Also

CeRapiInit

RAPIINIT

Last updated on Friday, April 22, 2005

© 2005 Microsoft Corporation. All rights reserved.

Send feedback on this topic to the authors.