delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/03/21/12:30:17

From: j-cerney1 AT ti DOT com (John Cerney)
Subject: Re: Another problem with DLL's
21 Mar 1997 12:30:17 -0800 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <BMSMTP85895694128a0182636.cygnus.gnu-win32@dsbmail.itg.ti.com>
Reply-To: John Cerney <j-cerney1 AT ti DOT com>
Mime-Version: 1.0
X-Mailer: BeyondMail for Windows/Professional 2.3
Original-To: "Valery Fine" <Valeri DOT Faine AT cern DOT ch>
X-BeyondMail-Priority: 1
Conversation-ID: <199703210841 DOT JAA24462 AT sp050 DOT cern DOT ch>
In-Reply-To: <199703210841.JAA24462@sp050.cern.ch>
Original-Cc: gnu-win32 AT cygnus DOT com
X-Receipt-From-Agent: true
Original-Sender: owner-gnu-win32 AT cygnus DOT com

>
>  > 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 AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019