www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Mysterious programme termination

reply 0ffh <spam frankhirsch.net> writes:
Hi,

forgive me if I am being really stupid, but I have something
here that really kind of mystifies me.

I have tried out the DLL code of spottedtiger, found at
http://spottedtiger.tripod.com/D_Language/D_WinDLL.html .

Trouble is: When I unload the DLL, no matter if I use the
Windows API example or std.loader, the whole programme
terminates. It seems that this was not noticed before,
as unloading the library is the last thing done in the
example. Just try to add a writefln after FreeLibrary,
respectively ExeModule_Release.

Any suggestions?

Regards,

   0ffh
Mar 25 2007
next sibling parent reply "Saaa" <empty needmail.com> writes:
 Any suggestions?

 Regards,

   0ffh
Posting it in learn :D Personally I think all questions should be asked in learn and after some discussion maybe reposted in whatever group is best. Just wanted to say that once. But maybe I read learn as help. Ah well... its out now :D
Mar 25 2007
parent 0ffh <spam frankhirsch.net> writes:
Saaa wrote:
 Posting it in learn :D
 Personally I think all questions should be asked in learn and
 after some discussion maybe reposted in whatever group is best.
 Just wanted to say that once.
 But maybe I read learn as help. Ah well... its out now :D
I suppose, you're right! Apologies all-round! BTW Walter's loader for Windows works fine, so I'm content... :) Regards, Frank
Mar 25 2007
prev sibling parent David L. Davis <SpottedTiger yahoo.com> writes:
0ffh,

   Sorry to hear you had some issues, but I've copied and pasted the all
example code from my site into files, and was able to compile / run everything
just fine. 
 
   Have you modified an example, and that's the version which doesn't work?
Also, may I ask which version of D (dmd), on which Windows' version did you
compile and run on?

-----------

Below, under WinVista Utl 32-bit with D (dmd) v1.010 using the example from the
MKoD site...shows the command (cmd.exe) line compiles, along with running the
programs:
 
C:\dmd\MKOD_ex>dmd WinDLL.d WinDLL.def
C:\dmd\bin\..\..\dm\bin\link.exe WinDLL,,,user32+kernel32,WinDLL.def/noi;

C:\dmd\MKOD_ex>dmd Main_WinAPI.d
C:\dmd\bin\..\..\dm\bin\link.exe Main_WinAPI,,,user32+kernel32/noi;

C:\dmd\MKOD_ex>main_winapi
sLibName="C:\dmd\MKOD_ex\WinDLL.dll", hLibWinDLL=10000000
Testing isroman( 'C' ) = 1
Testing isromanstr( "MMVC" ) = 1
Testing isromanstr( "ABCDEF" ) = 0

C:\dmd\MKOD_ex>dmd Main_Loader.d
C:\dmd\bin\..\..\dm\bin\link.exe Main_Loader,,,user32+kernel32/noi;

C:\dmd\MKOD_ex>main_loader
"C:\dmd\MKOD_ex\WinDLL.dll" is loaded, hLibWinDLL=10000000
Testing isromanstr("MMVC") = 1
Testing isromanstr( "ABCDEF" ) = 0

C:\dmd\MKOD_ex>

------------

   Everything appears to be compiling and running as  it should...maybe you
could you show an example of your commandline.

Kind Regards, 
David L. 'SpottedTiger' Davis

(Feel free to ask me questions about this code using my email, or post
questions into the learn section)

------------------------------------------------------------------- 
"Dare to reach for the Stars...Dare to Dream, Build, and Achieve!"
-------------------------------------------------------------------
MKoD: http://spottedtiger.tripod.com/D_Language/D_Main_XP.html

0ffh Wrote:

 
 Hi,
 
 forgive me if I am being really stupid, but I have something
 here that really kind of mystifies me.
 
 I have tried out the DLL code of spottedtiger, found at
 http://spottedtiger.tripod.com/D_Language/D_WinDLL.html .
 
 Trouble is: When I unload the DLL, no matter if I use the
 Windows API example or std.loader, the whole programme
 terminates. It seems that this was not noticed before,
 as unloading the library is the last thing done in the
 example. Just try to add a writefln after FreeLibrary,
 respectively ExeModule_Release.
 
 Any suggestions?
 
 Regards,
 
    0ffh
Mar 26 2007