O'Reilly logo

Programming .NET Compact Framework 3.5 Second Edition by David Durant, Paul Yao

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix B. Windows API Allocation and Cleanup Functions

WHEN DOING .NET COMPACT FRAMEWORK PROGRAMMING, we prefer to write managed code. Sometimes, however, we want to do something—or must do something—that we cannot do with managed code alone. At such times, we call through to the underlying Windows API using the P/Invoke support built into the .NET Compact Framework (see Chapter 3, Platform Invoke).

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required