Solved

App.EXEName gives short rather than long filename

Posted on 2002-03-12
6
273 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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

803 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