comp.lang.ada
 help / color / mirror / Atom feed
From: dennison@telepath.com (Ted Dennison)
Subject: Re: DLL dynamic load
Date: 5 Sep 2002 06:48:36 -0700
Date: 2002-09-05T13:48:36+00:00	[thread overview]
Message-ID: <4519e058.0209050548.22ad62ce@posting.google.com> (raw)
In-Reply-To: 3D76A22B.5080803@nospam.wanadoo.fr

Fabien Garcia <Fabien.garcia6@nospam.wanadoo.fr> wrote in message news:<3D76A22B.5080803@nospam.wanadoo.fr>...
> I'm using gnat 3.13p on windows XP and I'm trying to find where the 
> dynamic load of a DLL is explained (if it is at all possible).
> Here are my questions :
> 	- Is it possible to load a DLL at a specific moment at runtime
> (The point being that I want to load a different dll implementing the 
> same API depending on the task my application is set to, like for 
> exemple in plugins-enabled applications)
>          - If so, can someone send me a small example program doing so ?
>          - If not, what is the use of dynamic library except for 
> compilation/linking benefits

Yes, you can do that (its called "explicit linking"). Its just a
matter of calling LoadLibrary (or LoadLibraryEx) when you want it
loaded (and call FreeLibrary if you want it unloaded before your
program terminates). If you do it this way, you also have to call
GetModuleHandle to get pointers to all the routines in the DLL which
you want to use.

This is standard Win32 programming, and as such the best place to look
for examples and documentation are the usual Win32 sources (MSDN,
Win32 programming books, etc.)

However, for what you seem to be wanting to do, I think COM might be a
better approach. I'd suggest you go look at
http://www.adapower.com/gnatcom/index.html for Gnat support for COM
and http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndcom/html/msdn_dcomarch.asp
for more information on COM (DCOM) itself.



  reply	other threads:[~2002-09-05 13:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-05  0:15 DLL dynamic load Fabien Garcia
2002-09-05 13:48 ` Ted Dennison [this message]
2002-09-06 13:05   ` Fabien Garcia
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox