Handling Errors

< BACK  NEXT >
[oR]

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; 

< BACK  NEXT >


Windows CE 3. 0 Application Programming
Windows CE 3.0: Application Programming (Prentice Hall Series on Microsoft Technologies)
ISBN: 0130255920
EAN: 2147483647
Year: 2002
Pages: 181

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net