O'Reilly logo

Delphi for .NET Developer’s Guide by Xavier Pacheco

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

Using .NET Routines in Win32 Code

The CLR offers support for the opposite of what Platform Invoke offers, which is to expose .NET static methods to the unmanaged Win32 world. These are often referred to as unmanaged exports. Unmanaged exports are implemented by the CLR using the exact inverse of its P/Invoke mechanism which is why the support is sometimes referred to as Inverse P/Invoke.

A Win32 application can import these exposed routines in the same way as with any regular DLL exported routines. The support for this CLR feature is not taken advantage of by many languages; only Managed C++ and Delphi for .NET support it directly as a language feature. In Delphi’s case, it is limited to exporting global functions, which internally are implemented ...

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