Download CD Content
In this chapter, you will learn how to:
The issues that affect managed and unmanaged code
How to use managed objects in unmanaged code
How to use the Platform Invoke mechanism to call unmanaged functions in DLLs
Although this book is concerned with using managed C++ with the Microsoft .NET Framework, at times you’ll have to call functions outside the .NET environment.
The System::Runtime::InteropServices namespace contains classes and structures to help with interoperation between .NET and the outside world. In this chapter, I’ll introduce one feature of the namespace—the Platform Invoke mechanism for calling unmanaged functions within DLLs—and will investigate some of the other issues that surround interacting with unmanaged code. The final chapter will consider interoperating between COM and .NET.