View mode: basic / threaded / horizontal-split · Log in · Help
December 30, 2011
DLL with D (FreeLibrary problem)
Hello everybody.
I'm trying to write a DLL in D. Everything is actually working fine, until I reach FreeLibrary,
which terminates the test program (written in D) with code 0x1. DllMain is called correctly,
and seems to run through. But I never reach the lines after the FreeLib call.


When I write the same program in C++, to test the DLL, I have a similar problem,
although the program doesn't crash. Nothing is printed, after FreeLib, but it's still
waiting for the input at getch().

C++ Program:

I'm still new to DLLs, or rather system programming in general,
and actually have near to no idea, what could be going wrong here.

December 30, 2011
Re: DLL with D (FreeLibrary problem)
It appears as if the following code in the detach case solves the problem:
> std.c.stdio._fcloseallp = null;

I'm not sure why though... why is the call such a problem, that even crashes the application, and doesn't it have any disadvantages, not to call it?
Top | Discussion index | About this forum | D home