FoxPro Programming
VFP created .exe file does not run
Gravatar is a globally recognized avatar based on your email address. VFP created .exe file does not run
  fredkarm
  All
  Jan 21, 2023 @ 09:28am

I created a simple form and included it in a prg file with a wait window statement. Then I created a project with the prg and compiled it as a win .exe file. But when I run the test .exe file nothing happens, a window just flashes momentarily. I have included the vfp 9 runtime files in that directory (vfp9r,vfp9t and vfp9renu

Gravatar is a globally recognized avatar based on your email address. re: VFP created .exe file does not run
  fredkarm
  fredkarm
  Jan 21, 2023 @ 09:10pm

The file (myproj.exe) runs from within Foxpro with or without the Read Events, but the wait 'completed' window does not show after the form is closed. However, if I run myproj.exe from the dos command window or double click in file explorer, nothing happens - just a flash of the window.

Gravatar is a globally recognized avatar based on your email address. re: VFP created .exe file does not run
  Tore Bleken
  fredkarm
  Jan 21, 2023 @ 09:45pm

With too little information, I can only guess. What's the code in the main prg? Missing runtime files?
See the link in my previous email.

Gravatar is a globally recognized avatar based on your email address. re: VFP created .exe file does not run
  fredkarm
  Tore Bleken
  Jan 23, 2023 @ 11:34am

There is really no code .. just a form myproj with a command button that says 'Hello'. A prg file that has a ```foxpro

do form myproj

Then I created a project myproj and build a win32 exe file. I set it up to test if the .exe file works.

From within foxpro 'do myproj.exe' works but not from dos, or by double clicking in File explorer. I have the 3 run time files Vfp9r.dll Vfp9t.dll Vfp9Renu.dll in the same directory.

If there is a way to attach these I can but all it is a very simple form with a Hello button called from a prg file, and a .exe created to test that this form comes up.

Gravatar is a globally recognized avatar based on your email address. re: VFP created .exe file does not run
  Tore Bleken
  fredkarm
  Jan 23, 2023 @ 12:20pm

As I already told you:

Do form myproj
Read events
Gravatar is a globally recognized avatar based on your email address. re: VFP created .exe file does not run
  Aldrin Austria
  fredkarm
  Jan 24, 2023 @ 08:47am

Set your form WindowType property to modal.

Gravatar is a globally recognized avatar based on your email address. re: VFP created .exe file does not run
  fredkarm
  Aldrin Austria
  Jan 24, 2023 @ 11:41am

I had already added the Read Events but that did not work. I will check into the modal form type. Thanks

Gravatar is a globally recognized avatar based on your email address. re: VFP created .exe file does not run
  fredkarm
  fredkarm
  Jan 24, 2023 @ 11:55am

I do have the Read Events and tried with show window as 0 and 1 but when I double click in explorer a window just flashes and nothing happens. Is there a way I ann attach the files to be viewed on the message board?

Gravatar is a globally recognized avatar based on your email address. re: VFP created .exe file does not run
  Rick Strahl
  fredkarm
  Jan 25, 2023 @ 12:55pm

No we don't allow file uploads. If you can't summarize what you're doing nobody is likely to look at your code.

You can post the relevant code snippets in messages here. If you do, please make sure to use the code formatting features to format your code (see instruction on the bottom, and the post toolbar).

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: VFP created .exe file does not run
  fredkarm
  Rick Strahl
  Jan 26, 2023 @ 11:24am

Here is the code. For the myproj.prg file

do form myproj
read events
wait window 'completed'

The code for myproj.scx is simply a command button with 'Hello' caption.

Project myproj created with myproj.prg added which adds form as well. Win32 executable built from project. Double clicking on myproj.exe just makes the window flash.

Vfp9r.dll Vfp9t.dll Vfp9Renu.dll added to directory. Wondering if they are the right version - they are dated 12-13-2004. Foxpro version is 09.00.0000.2412. Not sure if SP2 applied, would any of this create a problem?

Gravatar is a globally recognized avatar based on your email address. re: VFP created .exe file does not run
  fredkarm
  fredkarm
  Jan 26, 2023 @ 10:58pm

Actually the code is fine, because when I create a .prg on another computer with VFP 6 instead of vfp 9, and the same form with a Hello caption command button, the .exe works fine from explorer. It may be that one the vfp 9 computer I do not have SP2, or the runtime files are not the correct version. Any recommendations?

Gravatar is a globally recognized avatar based on your email address. re: VFP created .exe file does not run
  fredkarm
  Tore Bleken
  Jan 27, 2023 @ 06:54pm

That is exacty what it was. I installed VFP 9, and then applied SP2. The runtime files had a 2007 date, and the same code worked fine. Thanks for all your help.

© 1996-2024