Subject: Re: Another problem with DLL's
From: [email-masked] (John Cerney)

21 Mar 1997 12:30:17 -0800
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Reply-To: John Cerney <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7Bit
X-Mailer: BeyondMail for Windows/Professional 2.3
Original-To: "Valery Fine" <[email-masked]>
X-BeyondMail-Priority: 1
Conversation-ID: <[email-masked]>
In-Reply-To: <[email-masked]>
Original-Cc: [email-masked]
X-Receipt-From-Agent: true
Original-Sender: [email-masked]

>
>  > 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
"[email-masked]" with one line of text: "help".