Appendix D. Windows API Allocation and Cleanup Functions

When doing .NET Compact Framework programming, we prefer to write managed code. There are times, however, when you want to do something—or must do something—that cannot be done with managed code alone. At such times, you call through to the underlying Windows API using the P/Invoke support built into the .NET Compact Framework (see Chapter 4).

The Windows API is an object-based programming interface, which is to say that objects are allocated and handles are issued for each object. In managed code, when you create managed objects, the cleanup of memory for those objects is handled for you automatically. This is often referred to as garbage collection, although we prefer calling this automatic ...

Get .NET Compact Framework Programming with Visual Basic .NET 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.