User forums > Help
Digital Mars DllMain not executed
(1/1)
jimp:
I have a problem when compiling a DLL with the Digital Mars compiler.
The program compiles with no warnings or errors. It is compiled with the options:
dmc.exe -mn -c -x -WD -w-
and linked with the options:
link.exe /NOLOGO /DELEXECUTABLE /EXETYPE:NT /SUBSYSTEM:WINDOWS
The calling program uses explicit linking with LoadLibrary and GetProcAddress. Both of these functions execute without getting an error. But the DllMain function is never called. I put a messagebox in the DllMain function to verify this.
I tried this with the Borland and GNU GCC compilers. It worked OK with both. It must be something about the Digital Mars compiler. An option? Something I am omitting? Or is it just not executed with explicit linking?
Why isn't the DllMain function being called????
Any suggestions would be appreciated.
takeshimiya:
Hope this helps a little: http://forums.codeblocks.org/index.php?topic=946.0
jimp:
I don't believe it but the above link actually allowed me to fix the problem.
It needed an input .def file. I copied the sample file given changing only the program name. Then I changed the command line to include the .def file. All the problems I had disappeared.
Some of the commands in the .def file can be included as options on the command line (EXETYPE NT, SUBSYSTEM WINDOWS) and some cannot (CODE SHARED EXECUTE, DATA WRITE). My guess is that CODE SHARED EXECUTE is what was needed to create a dll.
Thanks for the info. I probably never would have figured it out.
JimP
Michael:
Hello,
Have you tried to search in the forum if some of the posts could help you to solve your problems (you can use the advanced search for more powerful queries).
May be you can also try to post in the Digital Mars forum and see what they can tell you.
Best wishes,
Michael
Michael:
Could this post be of some help?
Michael
Navigation
[0] Message Index
Go to full version