Solved

App.EXEName gives short rather than long filename

Posted on 2002-03-12
6
265 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

758 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