DynamicLoad

Given a static function declaration, generate a loader with the same name in the current scope that loads the function dynamically from the given DLL.

version(Windows)
mixin template DynamicLoad (
string DLL
string NAME = __traits(identifier, F)
) {}

Members

Static functions

_loader
std.traits.ReturnType!F _loader(ARGS args)
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

mixin DynamicLoad!(GetVersion, "kernel32.dll");
GetVersion(); // called via GetProcAddress

// Multiple imports
mixin DynamicLoadMulti!("user32.dll", GetDC, ReleaseDC);

Meta