
EXE's Vs DLL's Naming Problem
Quote:
>The problem is not when unloading a VB application it occurs when
>trying to launch a VB application that has the same name as a already
>loaded DLL, eg CS7001.DLL is already loaded by CS7011.EXE and then
>trying to launch CS7001.EXE does not seem to work, renaming CS7001.EXE
>to some other name eg CS7001VB.EXE and then launching it actually
>works, I'm trying to determine if this is the correct solution.
The issue is not the name of the executable per se, but rather it's "module
name". The module name is a short (8 character) name that is embedded into
executables and DLLs, and is typically the basename (minus the extension) of
the file. In your case, the module name in question is "CS7001". When the
Windows loader is asked to load an EXE or DLL, it gets the module name from
the image and walks through the kernel's module table to determine if it's
already loaded. If it sees that a module has already been loaded, it simply
increases a reference count (since 16-bit applications share a single
instance of DLLs across applications) and returns.
The problem that you're running into is that when you attempt to load the
CS7001.EXE program, the loader sees that there is already a CS7001 module
(the DLL) in the table. You have two possible solutions. One is to simply
rename your executable (as you've already guessed), in which case there
isn't a conflict. The other is to change the module name of the DLL, which
can be done by changing the LIBRARY value in it's DEF file (this requires
that you have the source to the DLL, so that may not be practical).
----
Catalyst Development Corporation Web: http://www.catalyst.com