O'Reilly logo

Programming .NET Compact Framework 3.5 Second Edition by David Durant, Paul Yao

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Platform Invoke

In this chapter, we discuss Platform Invoke, a .NET feature for calling functions in native Win32 DLLs from managed code.

THIS CHAPTER COVERS Platform Invoke—also known as P/Invoke—a .NET feature for calling functions in native dynamic link libraries (DLLs). Most of the time the .NET Compact Framework provides all the support you need to build programs. Sometimes you need something that is not supported by the .NET Compact Framework but is supported by calling a function in a Win32 DLL. For such cases, there is P/Invoke.

To call a function in a native DLL from managed code, you create a P/Invoke wrapper. A P/Invoke wrapper looks just like a managed-code method declaration. One difference is that a P/Invoke wrapper lacks ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required