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.

  1. mixintemplate DynamicLoad(alias F, string DLL, string NAME = __traits(identifier, F))
    version(Windows)
    mixin template DynamicLoad (
    string DLL
    string NAME = __traits(identifier, F)
    ) {}
  2. mixintemplate DynamicLoadMulti(string DLL, FUNCS...)

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