Mysterious programme termination (appears to work just fine)

David L. Davis SpottedTiger at yahoo.com
Mon Mar 26 17:41:11 PDT 2007


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




More information about the Digitalmars-d mailing list