Handling Errors

Errors can occur either in the way the RAPI function is called on the desktop, or on the execution of the function on the Windows CE device. If a RAPI function call fails, the function CeRapiGetError returns an error from the device, or 0 if the error was a Win32 error. GetLastError can be called to determine the actual desktop error in this case. The following code shows error handling for a failed RAPI function.

int nErr = CeRapiGetError();
if(nErr == 0)
  cout ≪ "RAPI function failed, Win32 Error"
                  ≪ GetLastError() ≪ endl;
else
  cout ≪ " RAPI function failed, RAPI Error"
                   ≪ nErr ≪ endl;

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.27.202