Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This function creates a connection request but returns information only after the connection has been established or has failed.
Syntax
HRESULT WINAPI ConnMgrEstablishConnectionSync( CONNMGR_CONNECTIONINFO * pConnInfo, HANDLE * phConnection, DWORD dwTimeout, DWORD * pdwStatus ); |
Parameters
- pConnInfo
-
[in] Pointer to a CONNMGR_CONNECTIONINFOstructure that contains the parameters that describe the requested connection.
- phConnection
-
[out] Pointer to the returned connection handle.
- dwTimeout
-
[in] Specifies a timeout, in milliseconds, for connection establishment.
- pdwStatus
-
[out] Pointer to the final status value. Can be one of the Connection Manager status constants. This parameter is only set if the pointer passed in is a non-null pointer. For details, see Connection Manager Status Constants.
Return Values
Returns S_OKif successful. Returns an error code if the function call failed or if a timeout has occurred.
Remarks
This function uses ConnMgrEstablishConnectionand ConnMgrConnectionStatusinternally to attempt to fully establish a connection before returning to the caller. The ConnMgrEstablishConnectionSyncfunction does not provide an internal message pump. Therefore, the message queues of any user interface threads that call into this function are blocked until the function returns. A call to this function does not return until a connection has either been established or the attempt to create a connection has failed.
A Windows Mobile application can only have one outstanding connection request at a time. Therefore, once ConnMgrEstablishConnectionSyncor ConnMgrEstabishConnectionis called, they cannot be called again to create another connection request until the first connection request is released with ConnMgrReleaseConnection.
Requirements
Header | connmgr.h |
Library | cellcore.lib |
Windows Embedded CE | Windows CE .NET 4.2 and later, Windows Embedded NavReady 2009 |
Windows Mobile | Windows Mobile Version 5.0 and later |