The Relationship Between Managed and Unmanaged Code

Unmanaged code is what you have been writing with Visual C++ and MFC. Therefore, unmanaged code is the same type of application you are already used to. Managed code, on the other hand, is code that is written and compiled for the .NET Framework and runs with the help of the CLR.

Managed and unmanaged code have a common relationship in that they both resolve down to using the Win32 API at their lowest state. The differences arise in how the source code is written and structured as well as how the applications that are built run within the environments for which they were created. Figure 5.1 shows the relationship between managed and unmanaged code within a single executable.

Figure 5.1. The ...

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.