extern(Windows, "user32.dll")

Rikki Cattermole via Digitalmars-d digitalmars-d at puremagic.com
Sun Feb 1 02:40:59 PST 2015


On 1/02/2015 11:36 p.m., Vladimir Panteleev wrote:
> 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.

I see, reasonable.


More information about the Digitalmars-d mailing list