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.
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.
Note that DllExport
is not required to use type from one Elements library project from a different Elements on the same platform. All public
types and their pubbic
or protected
members will be available when referencing an Elements project via its .fx
file. It is also not required to expose Cocoa classes to Objective-C-based Xcode projects using your library.
DllExport
is meant for exporting symbols for use by other development tools, (such as C/C++), or to be called back by operating system APIs.
JNI Export and Anrdroid Extensions
When exporting methods for use with Java Native Interface (JNI), for example to export methods from an Android NDK project, the JNIExport
can be used instead of DllExpore
. JNIExport
will automatically apply the proper name mangling required for JNI, and more.
Island Only
The DllExport
aspect is available only on the Island platform.
type
MyClass = public class
public
[DllExport("DifferentName")]
class method MyMethod();
begin
...
end;
end;
public class MyClass
{
[DllExport("DifferentName")]
public static void MyMethod()
{
...
}
}
public class MyClass {
@DllExport("DifferentName")
public func MyMethod() {
...
}
}
public class MyClass {
@DllExport("DifferentName")
public static void MyMethod() {
...
}
}
public class MyClass {
<DllExport("DifferentName")>
Public Sub MyMethod()
..
End Sub
End Class
See Also
JNIExport
AspectExport
Aspect- Java Native Interface (Java)
DllImport
AspectDelayLoadDllImport
ApsectSymbolName