PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: David Kenny on March 18, 2008, 12:23:18 PM

Title: App.exename contains short file name?
Post by: David Kenny on March 18, 2008, 12:23:18 PM
Would it be easy to return the actual filename?

David
Title: Re: App.exename contains short file name?
Post by: TechSupport on March 18, 2008, 01:03:38 PM

DECLARE FUNCTION GetLongPathName LIB "kernel32.dll" ALIAS "GetLongPathNameA" _
   (lpszShortPath AS ASCIIZ, lpszLongPath AS ASCIIZ, BYVAL cchBuffer AS DWORD) _
   AS DWORD


Maybe something like this:


Local zFilename As ASCIIZ * %MAX_PATH
Local zBuffer As ASCIIZ * %MAX_PATH

' Set the zFilename to the "short" file name
zFilename = .........

' Convert to long filename
GetLongPathName zFilename, zBuffer, %MAX_PATH

' The variable "zBuffer" should now hold the long filename


Title: Re: App.exename contains short file name?
Post by: David Kenny on March 18, 2008, 01:30:11 PM
I was wondering how I didn't notice this before and I have found something interesting.  It only happens when compiled and executed from Firefly.  It works fine when executed external from FF.  I actually think it is more likely an interaction between the PB compiler and FF?

So, it is a non problem as far as I am concerned.  Thanks for looking into it Paul.  Sorry I wasted your time.

David
Title: Re: App.exename contains short file name?
Post by: TechSupport on March 18, 2008, 01:33:02 PM
If I remember correctly, I converted the filenames during the compile process to short in order to deal with PB 6 (or 7?) and also to deal with the SHELL command/function? That was a long time ago so there must have been a good reason to do so at the time. My memory is not like it used to be!  :D