This function creates a connection request but returns information only after the connection has been established or has failed.
Copy Code
HRESULT WINAPI ConnMgrEstablishConnectionSync(
CONNMGR_CONNECTIONINFO *pConnInfo,
HANDLE *phConnection,
DWORD dwTimeout,
DWORD *pdwStatus
);
Parameters
pConnInfo
[in] Pointer to a CONNMGR_CONNECTIONINFO structure 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_OK if successful, or an error code if the function call failed or if a timeout has occurred.
Remarks
This function uses ConnMgrEstablishConnection and ConnMgrConnectionStatus internally to attempt to fully establish a connection before returning to the caller. The ConnMgrEstablishConnectionSync function 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.
Requirements
OS Versions: Windows CE .NET 4.2 and later.
Header: Connmgr.h.
Copy Code
HRESULT WINAPI ConnMgrEstablishConnectionSync(
CONNMGR_CONNECTIONINFO *pConnInfo,
HANDLE *phConnection,
DWORD dwTimeout,
DWORD *pdwStatus
);
Parameters
pConnInfo
[in] Pointer to a CONNMGR_CONNECTIONINFO structure 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_OK if successful, or an error code if the function call failed or if a timeout has occurred.
Remarks
This function uses ConnMgrEstablishConnection and ConnMgrConnectionStatus internally to attempt to fully establish a connection before returning to the caller. The ConnMgrEstablishConnectionSync function 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.
Requirements
OS Versions: Windows CE .NET 4.2 and later.
Header: Connmgr.h.
'Windows > MFC' 카테고리의 다른 글
Making a Data Call Using Connection Manager (0) | 2013.10.02 |
---|---|
wcdma conection ConnMgrEstablishConnectionSync (0) | 2013.10.02 |
dialog (0) | 2013.10.02 |
TextSelection (0) | 2013.10.02 |
vs2005 macro (0) | 2013.10.02 |