extern(Windows, "user32.dll")

Benjamin Thaut via Digitalmars-d digitalmars-d at puremagic.com
Sun Feb 1 04:09:57 PST 2015


Am 01.02.2015 um 13:02 schrieb Vladimir Panteleev:

> But I haven't heard of this project before. In a few words, what does
> this do? Or a link to a DIP or existing discussion?

The last discussion is over a year old, the resulting DIP was DIP 45:
http://wiki.dlang.org/DIP45

The currently blocking issue for this implementation is, that export 
both means "public" and "dllexport" which is discussed here:
http://forum.dlang.org/thread/m9lhc3$1r1v$1@digitalmars.com

>
>> Thats why its called a proof of concept, it doesn't mean its perfect ;-)
>
> OK, but you can't solve these problems without using DLL imports, can you?

most likely not.


> But it's not just system Windows libraries, but all DLLs with a C
> interface. You won't need to mess with import libraries to load curl, or
> OpenSSL, or SQLite...

Yeah, but the problem is, that as soon as you do that you are limiting 
yourself to DLL versions of that library. If you for example want to 
link curl statically this will no longer work. And in my opinion its bad 
to hardcode in the sourcecode if your expecting a static or shared 
version of the library.

Thats also the nice thing about import libraries in my opinion. If you 
ship a library you can simply create two folders .e.g. one called static 
and the other called shared. Both contain .lib files with the same name. 
So the only thing a user as to do when he wants to switch between 
statically and dynamically linking against your library is changing the 
search directory passed to the linker.



More information about the Digitalmars-d mailing list