delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/07/08/07:51:39

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <19990708114949.30744.qmail@hotmail.com>
X-Originating-IP: [193.207.88.164]
From: Emanuele ALIBERTI <ealiberti AT hotmail DOT com>
To: dj AT delorie DOT com, rbresner AT olf DOT com
Cc: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: How can I get a .dll to resolve at runtime ?
Date: Thu, 08 Jul 1999 04:49:48 PDT
Mime-Version: 1.0

>I don't think so.  What you'd normally do is have the exe call the dll
>at startup and pass it pointers to its functions, which the dll would
>store in per-process memory (remember that dlls are shared among many
>executables).

The DLL image is actually loaded once and memory mapped n-times in the 
address space of each process that imports from it.

>One thing to try is to export the function with a .DEF file, and see
>if that works.  You'd have to build an import library for your
>executable and link the dll against that, but I'm not sure if NT would
>even *allow* such a hack.

Yes, it works. That is actually a quasi-static linking, because the loader 
fails to initialize a porcess if it does not find each DLL in the process 
image's imports table. You can also call an exported function by calling at 
run-time LoadLibrary() and asking for an entry point with GetProcAddress().


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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