Shared Library: Why doesn't this work?

Bryan Power bp2626 at yahoo.com
Sun Sep 28 10:06:58 PDT 2008


Benji Smith wrote:
>    if (auto lib = SharedLib.load(`c:\windows\system32\kernel32.dll`)

Just a note on the Windows library loading routines:

You should never use the absolute path. The root drive is not guaranteed 
to be C:, nor is the system directory guaranteed to be "system32". On 
older systems it may just be "system". Internally, the API .load is 
calling (LoadLibraryA/W) will automatically search the default system 
directory of your system, therefore only .load("kernel32.dll") is required.


More information about the Digitalmars-d-learn mailing list