Error Checking

As with any operating system, it is imperative to check the return results when calling Windows CE API functions—never assume that the function works. Many of the code samples in this book do not have sufficient error-checking code for use as production code, so you will need to add it if you take code from this book for use in your own applications.

Nearly all Windows CE API functions return a value indicating success or failure, but little information detailing the nature of the error. You should call the function GetLastError to determine the actual error number encountered. You can look up the error numbers in the header file winerror.h, where you will find a short description of the error. This file is located in the "\Windows ...

Get Windows® CE 3.0 Application Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.