Hi Paul!
If the current directory ( curdir() ) changes to something like C:\Windows\System32 your array gets populated by many exe's but not the exe's you expect from your application directory, because in you code you load adir() with exe's from the "current" directory.
lnExeNumber = ADIR(laPrograms, '*.EXE')
Gianni
-----Original Message----- On Wed, 02 May 2018 02:47:00 +0200, Gianni Turri giannit62@gmail.com wrote:
Hi Paul!
I remember many years ago when printing to pdf using the Adobe Acrobat printer driver that at the return from "report form ..." the curdir() was changed to something like C:\Windows\System32.
Are you sure it is not happening something similar?
Gianni
-----Original Message----- On Tue, 1 May 2018 15:23:55 -0500, "Paul H. Tarver" paul@tpcqpc.com wrote:
Thanks Ted.
The code I'm using now is how I determine the name of the compiled application and once it returns the correct .EXE name, we then look for an .INI file with the same JUSTSTEM() where our settings are. The code works whether compiled or in the IDE and the only requirement is that I have at least one copy of the compiled .exe file in the development folder.
I know I can hard code that easily enough, but because I have so many projects and they often have different compiled names, so the logic of looking in the app folder for an .EXE with 'MAIN PROGRAM' in the file version information makes the method to retrieve the JUSTSTEM('exe name') a simple prospect and has worked since version 6.
First time I've ever had a problem with it and that's only after the second time I get a handle to the Oracle database via the Oracle ODBC driver. Weird stuff.
Thanks for the suggestions though. I may end up refactoring this whole process anyway because of this weirdness.
Paul H. Tarver
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Ted Roche Sent: Tuesday, May 01, 2018 2:38 PM To: profoxtech@leafe.com Subject: Re: AGETFILEVERSION Fail
On Tue, May 1, 2018 at 3:23 PM, Paul H. Tarver paul@tpcqpc.com wrote:
The reason for this code is to identify the application .EXE. Perhaps
there
is a better way to identify the application name that will eliminate the need to use AGETFILEVERSION() to identify the main .exe file for the application.
You might consider PROGRAM(), the venerable SYS(16) or the (new to VFP7) AStackInfo().