DynamicLoadMulti

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))
  2. mixintemplate DynamicLoadMulti(string DLL, FUNCS...)
    version(Windows)
    mixin template DynamicLoadMulti (
    string DLL
    FUNCS...
    ) {}

Members

Mixins

__anonymous
mixin DynamicLoad!(FUNCS[0], DLL)
Undocumented in source.
__anonymous
mixin DynamicLoadMulti!(DLL, FUNCS[1..$])
Undocumented in source.

Examples

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

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

Meta