www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - DLLs in D

It would seem that I've run into a problem with Dll's in D.  Am I missing
something, or can anyone confirm that this a bug?

# import std.c.windows.windows;
# void main(){
#     HMODULE mod = LoadLibraryA("mydll.dll\0"); // from dmd/samples
#     printf("unloading...");
#     FreeLibrary(mod);
#     printf("done\n");
# }

This outputs "unloading..." and exits quietly, without an error message.
I've narrowed the problem down to unloading D dll's in particular, and haven't a
clue why it's something in D code that causes this to happen.  Running the above
example against any standard win32 dll runs as expected.

- Pragma
Aug 17 2004