Calling the Windows CE API
To call functions in the Windows CE API, you use the same P/Invoke mechanisms as have been discussed thus far. The key difference is that the Windows CE API is packaged in prewritten DLL files, rather than custom files created using tools such as eMbedded Visual C++.
The following example shows how a simple Windows CE API call can be made from managed code. The MessageBeep API function accepts a single 32-bit integer (for our purposes, this value can always be zero) and returns no value to the caller. As the name suggests, it sounds a short beep using the Windows CE sound system. This API function is found in the coredll.dll library.
Tip
Much of the Windows CE API is found in the coredll.dll library. Developers who are ...
Get Microsoft® .NET Compact Framework (Core Reference) 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.