Advanced Aspects of PInvoke
Although it's not strictly a COM Interop topic, I wanted to end this chapter by discussing some advanced aspects of PInvoke. You learned in Chapter 6 that PInvoke is a technology that allows you to make calls to functions in non-COM, unmanaged DLLs. In this section we will look at the following advanced aspects of PInvoke: Pointers, Callback Functions and Structures.
Pointers
Win32 DLLs that use pointers typically use them in one of 2 ways: (1) to return or receive an array, or (2) to return or receive a structure. We'll start our discussion of pointers by looking at a pair of Win32 API functions that demonstrate each of these usages.
The fourth parameter to the CreateFile function API function takes a pointer to a ...
Get .NET and COM Interoperability Handbook, The 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.