--- MikkelFJ <mikkelj-anti-spam / post1.dknet.dk> wrote:
> "Kevin Smith" <kevinbsmith / yahoo.com> wrote in message
>
news:20010825015907.31268.qmail / web13808.mail.yahoo.com...
> 
> > I've been out of the Windows internals game for a
while,
> > but I believe this is left over from the 16-bit days,
and
> > I've heard it will be fixed in Windows XP.
> 
> This XP fix - does this relate to the 16bit subsystem
> (WOW) or windows as whole?

AHA! The new feature is in Windows 2000, and here's a
writeup:
http://www.google.com/search?q=cache:2XHOC9Pz94U:www.informationweek.com/777/visua2.htm+%22windows+2000%22+dll+hell

Unfortunately, since many Ruby users won't have W2K, it
doesn't 
really help us. The problem is in NT, 98, ME, etc.

> > "Modules", as they refer to DLL's and EXE's, have a
short
> > name that is used internally. If that name already
exists
> > in memory, the copy in memory is reused, even if the
_path_
> > to load that module is different. Which is exactly what
you
> > describe.
> 
> However, there are many different ways to load a dll:

Indeed. The problem I'm referring to is for implicit DLL
linking. Not COM.

> To be sure, I just wrote a testapp, copying a test dll to
> two different
> places. Then I created a test program that loads the dll
> - which I ran twice
> simultanously. The program also investigates the module
> path of the loaded
> dll. In each instance, I loaded exactly the dll I wanted,
> and I had both
> dll's running simultanously.

I assume you used LoadLibrary. Instead, as a test, you
might try creating two different DLL's with the same module
name. Maybe it would have a "hello" function that would
return a constant string.

Now write one sample app for each DLL. Now try to run both
apps at the same time. I believe you will find that, at
least through Windows ME/NT, you will not be able to have
both DLL's loaded at the same time, because they share a
module name.

For _implicit_ linking, Windows has traditionally scanned
the list of loaded modules first, matching only on the
short name. Unfortunately, implicit linking is the "normal"
way to use DLL's, so it's a pretty big problem.

Kevin

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/