Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Project Name

Status
Not open for further replies.

inexperienced1

IS-IT--Management
Aug 9, 2002
49
US
I have an exe which uses a dll this dll needs to reference a cls module in the exe

I have the code, but at present I have to hard code the project name of the exe. Is it possible from within either the exe or the dll to reference the project name of the exe?
 
Look into the VB app object.
Code:
App.EXEName 'or
App.ProductName

zemp
 
Unfortunately these are not the Project Name, and as I understand the project name is what is registered in the registry.

 
I have looked at app.title, app.exename, app.productname

and neither of these provide the same name as set in project name, ie Project, Properties, Project Name

 
start a new project

Project>Properties>Project Name (Change to a new name)

add a command button

command1_click
msgbox app.title
end sub

works on my end
 
Only if they are the same.

If you change the project title and compile the code you will find that they become different.


 
Take a look at the AssemblyName class in System.Reflection, whose Name property should correspond to your project name.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Nevermind, forgot this is the VB6 forum...

As far as I know, there's no way to determine the project name from just a EXE. If it were a DLL then you could call LoadModule on it (a Win32 call), then do some COM calls in C or C++ to find out what typelibs it has.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
I see, sorry.

If you create the EXE as an activeX exe then you can set a property to reference..

Public Property Get EXENAME() As String
EXENAME = App.Title
End Property

then reference the property in the dll.

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top