Solved

App.EXEName gives short rather than long filename

Posted on 2002-03-12
6
269 Views
Last Modified: 2007-12-19

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?

0
Comment
Question by:hirop
  • 5
6 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6857432
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)
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6857449
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)
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6857454
that problem happens on a old win95?
With NT, it couldn't be a problem.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:hirop
ID: 6857495

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
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6857764
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.
0
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 300 total points
ID: 6857770
where did you develop that dll?, which OS?, from where deployment package cames?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now