Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why need to copy .exe to .fxp?
Message
From
15/06/2016 13:26:38
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01637355
Message ID:
01637379
Views:
54
>Hi,
>
>I have one customer with somewhat weird situation of running my VFP 9 application. They have a desktop shortcut that has the target the application executable (e.g. MyApp.exe) and it starts in the application folder (e.g. \\servername\myapplfolder)
>
>But when the user double clicks on this shortcut, the application opens with an empty window pointing to need to DO some program. I copied the application file, MyApp.exe, to the same name and extension .fxp - MyApp.fxp. And now user can select this file, MyApp.fxp when prompted to DO a program. And the application works.
>
>All other customers do not need to do it; simply starting the MyApp.exe works.
>
>Why, do you think, in this case the program is looking for an .FXP file of the same name as the application?
>
>TIA

I've seen this happen on a number of occasions -- in some occasions in invalid entry in the PATH environment variable was causing problems. On other occasions it was connected to network security and wasn't peculiar to UNC paths as it occurred on mapped drives as well. My best guess is likely connected to how a VFP program compiled to EXE is structured -- basically it's an EXE loader with an attached p-code file (e.g. FXP or APP). Launching the EXE then basically involves loading into memory the runtime loader (the beginning part of the VFP EXE application), followed by loading the runtime DLLs, then finally loading the pcode file (which entails reading the EXE itself) -- and this is probably where it runs afoul with security (this type of behavior is typical of a virus-infected program).

As you discovered, one possible workaround is to copy the EXE to an APP or FXP file, then using that as the parameter. What I've done in the past was change the shortcut so that the command line is set to launch the EXE with the APP as the command-line parameter. For example, if the shortcut to the EXE launches:
\\machine\apploc\myapp.exe
I change the command line to read:
"\\machine\apploc\myapp.exe" "\\machine\apploc\myapp.app"
after copying the EXE to a file with an APP extension.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform