ICcService::Connect (Compact 2013)
3/26/2014
Deprecated.
This method establishes a connection for service between host and device.
Syntax
HRESULT Connect(
DWORD dwTimeout,
VARIANT_BOOLbAsync,
DWORD* pdwCookieId
);
Parameters
- dwTimeout
[in] Timeout, in milliseconds, for the connection attempt to wait before returning to the client.
bAsync
[in] Indicator for asynchronous call.If this is set to VARIANT_TRUE, the method returns immediately. In that case, clients can get status on the connect progress through the callback function and dwTimeout is ignored.
- pdwCookieId
[out, retval] A valid cookie that identifies the method call. Callers can use this cookie in calls to ICcService::Abort to cancel a pending asynchronous call.
Return Value
The following table shows return values for this method.
Value |
Description |
---|---|
S_OK |
Indicates success. |
E_PENDING |
Indicates that a connection could not be established within the given dwTimeout. This status code is also returned if a connection request is pending on this same service. Users can try again with a different timeout. |
E_FAIL |
Indicates failure. |
Remarks
If this call is successful, the service should set its internal state to the SERVICE_INIT_CONFIGURE_CONNECT value.
If a client calls this method multiple times and the service is connected, the method call translates to a NOOP command.
If clients pass in VARIANT_TRUE for the second parameter, the timeout parameter is ignored and the call returns immediately. In this case the service state is set to SERVICE_INIT_CONNECT_PENDING. In the case of an extremely fast connection, the service state is set to SERVICE_INIT_CONFIGURE_CONNECT.
Clients can get the status of this request through ICcServiceCB. This call returns immediately if the service is initialized and an outstanding connection request is pending.
Requirements
Header |
ccservice.h |