Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Retrieving Last Error Code For OBEX (Windows Embedded CE 6.0)

1/6/2010

During send and receive operations, some applications may need to retrieve the last error code indicated by the OBEX server. The response is an 8-bit code that is defined in the official OBEX specification available at this Official IrDA Web site.

To retrieve the last error code, call IUnknown::QueryInterface on the IStream object that was used for sending and receiving the raw data by passing IID_IObexResponse in the iid parameter.

QueryInterface returns an IObexResponse:IUnknown object that can be used to retrieve the last response code.

Ee495265.note(en-US,WinEmbedded.60).gifNote:
IObexResponse object can only be used for stream operations.

The following code example shows how to retrieve the last response code.

// Assume that pMyStream has already been initialized
IObexResponse *pResp; 
BYTE lastResponse; 

hr = pMyStream->QueryInterface(IID_IObexResponse,(void**)&pResp);
if (FAILED(hr))
         goto cleanup; 

hr = pResp->GetLastResponseCode(&lastResponse); 
if (FAILED(hr)) 
         goto cleanup;

The application can call the IObexResponse::GetLastResponseCode method, to determine the last response code, at any point during a send and receive operation.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.