Link to home
Start Free TrialLog in
Avatar of hirop
hirop

asked on

App.EXEName gives short rather than long filename


When instantiating a class from a DLL, I am finding that the DLL's property App.EXEName is producing the short form of the DLL filename (the 'mangled' version containing the '~' character) on some workstations, and the long filename on others.

Does anyone know what can cause this to happen, and how I can force the DLL to give the long filename?

Avatar of Richie_Simonetti
Richie_Simonetti
Flag of Argentina image

That's not a problem with your app, it a problem with a system dll which is older than required.
Some Windows OS has this dll out of date. Unfortunatelly, i dont know which is.
Do a test on machines with problem:
try to open a longname file with notepad and see if open dialog shows short or long files names (also, a possible melt of both like c:\mydocnAGV$\myfile.txt or other scare letters like that)
one possible solution is always use short name with this api:
Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long

dim buff as string
dim ret as long
buff=space$(255)
ret =GetShortPathName(app.exename,buff,255)

msgbox left$(buff,ret)
that problem happens on a old win95?
With NT, it couldn't be a problem.
Avatar of hirop
hirop

ASKER


Hi Richie,

Thanks for your comments. We run a mixture of NT4 and Win2k workstations, using VB6 and SourceSafe. I've seen the problem on both NT4 and Win2k.

The DLLs that give the symptom are ones that we have written. The DLLs 'capture' some parameters and write them to a database. Unfortunately, I need to have the *long* filename in all cases so we can see at a glance which DLL did the capturing.

Regards,

Nick
What i meant is that there is a dll in the system that doesn't parse long file names very well due to out of date one, not your dll.
That dll (System dll) could be part of your installation package which has putting a "downgrade" version of.
ASKER CERTIFIED SOLUTION
Avatar of Richie_Simonetti
Richie_Simonetti
Flag of Argentina image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial