extern(Windows, "user32.dll")

Vladimir Panteleev via Digitalmars-d digitalmars-d at puremagic.com
Sun Feb 1 02:36:26 PST 2015


On Sunday, 1 February 2015 at 10:34:05 UTC, Rikki Cattermole 
wrote:
> How about:
>
> extern(System, "mylibrary"):
>
> That way it'll be a bit more cross platform'ish.

DLLs can have any extension. Many Windows components that don't 
have a .exe or .dll extension are actually PE files.

You should be able to define the library as a constant, e.g.:

enum user32 = "user32.dll";

extern(Windows, user32) DWORD MessageBox(...);

This is also what Delphi does.

Then you can put the enum in version(...) blocks.


More information about the Digitalmars-d mailing list