EXE's Vs DLL's Naming Problem 
Author Message
 EXE's Vs DLL's Naming Problem

Here is a summary of the problem

I have 2 applications both written in VB 3.0, CS7001.EXE and
CS7011.EXE.

I Run CS7011.EXE it loads 2 DLL's CS7011.DLL and CS7001.DLL.
When I try to launch CS7001.EXE it will not run, however the instance
count for CS7001.DLL in my DLL Manager increases to 2.

If I rename my EXE's to be CS7001VB.EXE and CS7011VB.EXE the
problem seems to go away and I can run both applications parrallel.

Question : Is this the correct solution and if so why, if it is not
the correct solution can anyone tell me what is.


Thanks



Mon, 21 Jun 1999 03:00:00 GMT  
 EXE's Vs DLL's Naming Problem

Quote:

>Here is a summary of the problem
>I have 2 applications both written in VB 3.0, CS7001.EXE and
>CS7011.EXE.
>I Run CS7011.EXE it loads 2 DLL's CS7011.DLL and CS7001.DLL.
>When I try to launch CS7001.EXE it will not run, however the instance
>count for CS7001.DLL in my DLL Manager increases to 2.
>If I rename my EXE's to be CS7001VB.EXE and CS7011VB.EXE the
>problem seems to go away and I can run both applications parrallel.
>Question : Is this the correct solution and if so why, if it is not
>the correct solution can anyone tell me what is.

>Thanks

Are you sure that you completely unload all the code in your VB
program? (frmBlah.Unload I think). You should check whether DLLs are
unloaded as well. I think there is an API specifically for that. If
not, use system process monitoring APIs

Alex

Alex


------
System report? RAM is ramming, electrons zinging.
All  systems go - or already gone.



Tue, 22 Jun 1999 03:00:00 GMT  
 EXE's Vs DLL's Naming Problem

Quote:


>>Here is a summary of the problem
>>I have 2 applications both written in VB 3.0, CS7001.EXE and
>>CS7011.EXE.
>>I Run CS7011.EXE it loads 2 DLL's CS7011.DLL and CS7001.DLL.
>>When I try to launch CS7001.EXE it will not run, however the instance
>>count for CS7001.DLL in my DLL Manager increases to 2.
>>If I rename my EXE's to be CS7001VB.EXE and CS7011VB.EXE the
>>problem seems to go away and I can run both applications parrallel.
>>Question : Is this the correct solution and if so why, if it is not
>>the correct solution can anyone tell me what is.

>>Thanks
>Are you sure that you completely unload all the code in your VB
>program? (frmBlah.Unload I think). You should check whether DLLs are
>unloaded as well. I think there is an API specifically for that. If
>not, use system process monitoring APIs

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.

Matt



Tue, 22 Jun 1999 03:00:00 GMT  
 EXE's Vs DLL's Naming Problem

I had a similar problem with a VB3 exe that called a dll named after the
exe.
My quick solution to this was ro rename one of the two to a different name.

Antoine



Tue, 22 Jun 1999 03:00:00 GMT  
 EXE's Vs DLL's Naming Problem



Quote:

[snip]
> >Are you sure that you completely unload all the code in your VB
> >program? (frmBlah.Unload I think). You should check whether DLLs are
> >unloaded as well. I think there is an API specifically for that. If
> >not, use system process monitoring APIs

> 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 problem is that Win3.x will give you UNENDING headaches if your DLL's
and EXE's are the same name.  Your ONLY option is to make sure the DLL and
EXE have different names.

--
Robert Simpson
Programmer at Large
BC Software
Phx, AZ

http://www.primenet.com/~simpson



Tue, 22 Jun 1999 03:00:00 GMT  
 EXE's Vs DLL's Naming Problem


Quote:


>>>Here is a summary of the problem
>>>I have 2 applications both written in VB 3.0, CS7001.EXE and
>>>CS7011.EXE.
>>>I Run CS7011.EXE it loads 2 DLL's CS7011.DLL and CS7001.DLL.
>>>When I try to launch CS7001.EXE it will not run, however the instance
>>>count for CS7001.DLL in my DLL Manager increases to 2.
>>>If I rename my EXE's to be CS7001VB.EXE and CS7011VB.EXE the
>>>problem seems to go away and I can run both applications parrallel.
>>>Question : Is this the correct solution and if so why, if it is not
>>>the correct solution can anyone tell me what is.

>>>Thanks
>>Are you sure that you completely unload all the code in your VB
>>program? (frmBlah.Unload I think). You should check whether DLLs are
>>unloaded as well. I think there is an API specifically for that. If
>>not, use system process monitoring APIs
>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.

It is.

EXEs and DLLs are Windows "modules" and in 3.1 are identified by a module
name.  The module name is normally the file name without the directory
path or extension (thus a max of eight chars, the 8 of the 8.3 file name).
Thus two files differing only in location or extensions would have the
same module name.
  Win3.1 first searches for a loaded module by name.  If one is found,
Win3.1 uses that copy instead of loading another.
  It's a known "gotcha" of 16-bit Windows, probable reason is to save
memory space which can be precious in the 16-bit environment.

--
Henry S. Takeuchi

Seattle, Washington (USA)



Wed, 23 Jun 1999 03:00:00 GMT  
 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



Thu, 24 Jun 1999 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Extracting Icons from Exe's Dll's Ico's into a ListImage Control

2. Help:Using VB Funtions In Access With DLL's, EXE's

3. Help:Using VB Funtions In Access With DLL's, EXE's

4. Compiled Dll's Exe's and references

5. Including dll's and ocx's in VB exe file

6. Help:Using VB Funtions In Access With DLL's, EXE's

7. Visual Basic 5.0 .EXE's and the various DLL's it needs

8. ActiveX dll's and EXE's

9. Licensing for ActiveX DLL's and EXE's

10. Visual Basic 5.0 .EXE's and the various DLL's it needs

11. Visual Basic 5.0 .EXE's and the various DLL's it needs

12. Help:Using VB Funtions In Access With DLL's, EXE's

 

 
Powered by phpBB® Forum Software