Hour 22. Mixing Managed and Unmanaged Code

During the last hour you learned how to utilize COM Interop to communicate between .NET and COM. Although COM is certainly pervasive throughout the operating system, the WIN32 API is still contained in dynamic link libraries and exported as C-style functions with certain calling conventions. Because the WIN32 API was built before .NET came into existence, the API functions obviously all run within an unmanaged environment. Even though the .NET Framework can handle a wide variety of tasks, there may still be times when you need to invoke a function contained within a DLL. Include the fact that you may already have libraries used with some of your current projects, and you can see why this interoperability ...

Get Sams Teach Yourself Visual C++® .NET in 24 Hours 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.