Chapter 9. Calling Unmanaged Code

Terms you'll need to understand:

  • Managed code

  • Platform invoke

  • Runtime callable wrapper (RCW)

  • Unmanaged code

Techniques you'll need to master:

  • Instantiating and invoking existing COM/COM+ components by creating a runtime callable wrapper (RCW)

  • Using platform invoke (PInvoke) to invoke some common Windows API calls

In this chapter, you learn about the tools and techniques necessary to call unmanaged code—COM components and Windows API code from the .NET Framework. Basically, the process of using unmanaged code from various server components is similar. I'll use Web services for most of the examples in this chapter; however, you can follow the same process for other .NET applications.

COM Components

.NET components can call ...

Get Developing XML Web Services and Server Components with Visual C# .NET and the .NET Framework, Exam Cram 2 (Exam 70-320) 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.