Skip to content
Denis Kuzmin [ github.com/3F ] edited this page Apr 3, 2018 · 13 revisions

Start with:

DllExport -action Configure

How to (Screencast)

~ ~ ~ --- ~ ~ ~

Configuring the projects

Since v1.6 provides new embeddable manager, you can configure your projects in a few seconds by the following steps below.

  1. Get DllExport.bat
  2. Use command -action Configure
  3. Select some available projects for install operations and configure this as you need.
  4. (optional) Define storage for settings.
  5. Click [Apply].

Now you're ready to provide exported-functions for unmanaged environments from .NET projects.

To start export

For creating your first function: Just define DllExport attribute for your favorite static methods.

For example:

[DllExport]
public static void hello() { }
[DllExport]
public static int hello(IntPtr ptr)
{
    return 0;
}

You can also define specific calling convention and custom name:

[DllExport("Init", CallingConvention.Cdecl)]
// __cdecl is the default calling convention for our library as and for C and C++ programs
[DllExport(CallingConvention.StdCall)]
[DllExport("MyFunc")]

What types ?

Do not use complex types for arguments & for return value.

Only primitive types.

You should use pointer to allocated data for complex types if you need.

For example, IntPtr instead of String.

Related:

πŸ—Ž

πŸ—”

πŸ“‚

  • πŸ“’ Q/A
Clone this wiki locally