PInvoker Logo
The PInvoke Interface Generation Tools Site

What is PInvoker ?

PInvoker .NET generates a pinvoke based .NET interop assembly (dll) by importing a number of C++ static dlls and a C++ header file (.h).

It imports the functions and variables exported by the native static dll, finds their definitions in the header file and from these exports pinvoke compatible types and functions in a .NET interop assembly (dll).

The generated pinvoke based interop assembly gives applications written in C#, VB.NET or any other .NET language access to the functions and variables in the native dlls.

What does the PInvoker Installation Contain ?

The PInvoker installation contains two applications.

PInvoker.exe is a console application for use in continuous build environments. It can also be run as part of a post-build step in Visual Studio projects to automatically generate a .NET interop assembly whilst building a solution.

PInvokerGui.exe is a windows forms application which provides a user interface for the console application. This allows configuration settings to be easily defined and a project file exported which can then be read by the console-application form of PInvoker.

What does PInvoker Support ?

The current version of PInvoker produces pinvoke based interop assemblies for

  • Dll Exported variables.
  • Dll Exported functions (stdcall and cdecl).
  • Arrays.
  • Strings.
  • Classes and Structures with public member variables only.
  • Bitfield structures.
  • Unions.
  • Enums.
  • Function pointers.
  • Typedefs.
  • Namespaces.
  • Nested types.
  • Constants (constant variables in namespace scope and #define constants).

Support for the following is to be included in future versions

  • Classes and structures with protected and private members.
  • __declspec(dllexport) classes
  • Instance methods.
  • Constructors and destructors.
  • Inheritance.
  • Interfaces.
  • COM types (BSTR etc).
  • Templates.
  • STL Headers.
  • Interface generation for x64 processors (64-bit).

The interface assemblies produced by PInvoker are compatible with the compact framework 2.0 except for

  • Returning structs by value from functions.


The .NET interop assemblies generated by PInvoker require the PInvoker.Marshal.dll assembly.

This file is verifyable and freely distributable and can be copied and deployed with your applications as required.

PInvoker uses the .NET 2.0 SP2 Framework.

Copyright © Kilapara Limited 2018
Contact us