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