DllExport

The DllExport aspect marks a static method, static field or a type to be available externally from the current project (usually a dynamic library, such a .dll, .so, or .dylib, depending on platform).

It takes an optional String parameter which lets you override the default name the symbol will be exported under. When exporting methods for use with Java Native Interface (JNI), for example to export methods from an Android NDK, the JNIExport can be used instead of DllExpore. JNIExport will automatically apply the proper name mangling required for JNI, and more.

For all platforms, exports a method, static field or type from the given dynamic library. This can also be set globally by setting the option. When used on methods or fields, the SymbolName attribute can be used to override the name which it gets exported with.

Island Only

The DllExport aspect is available only on the Island platform.

type
  MyClass = public class 
  public  
    [DllExport("Foo.dll")]
    class method SomeNativeCode(); external;
  end;
public class MyClass
{
    [DllExport("Foo.dll")]
    public static extern void SomeNativeCode();
}
public class MyClass {
    @DllExport("Foo.dll")
    public extern func SomeNativeCode() {
    }
}
public class MyClass {
    @DllImport("Foo.dll")
    public static extern void SomeNativeCode();
}

See Also