This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Another problem with DLL's



>
>  > I'm not sure what is wrong with your code, but I know this does
>  > work. Here is a simple example of loading a DLL at runtime using
>  > LoadLibraryEx calls. This compiles and links fine on both win95 and
>  > winNT.
>  
>     Hello John!
>  
>     Just one question. Did you try to compile your MAIN with VC++ but 
>  DLL with gnu-win32 ? Does it work ?


I just tried compiling the main2.c with VC++. 

When running, the thing crashes when the DLL function is called. An access
violation occurs in cygwin.dll. The foo.dll that is built uses cygwin.dll for
its printf function. If I take the printf out of the foo.dll code the VC++
main2.exe will run just fine. 

I think when a gnuwin32 main program is linked, some code to initialize the
cygwin system is included. Since we compile the main program here using VC++, I
suspect that the cygwin.dll never gets initialized, and crashes when its
functions are called. It is possible that this might be fixed by adding some
initialization routines to the dll_entry routine for the dll.


Regards,

John
-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]