Link to home
Start Free TrialLog in
Avatar of jruhe
jruheFlag for United States of America

asked on

VFP Visual FoxPro 8 - Creating an EXE that works

Hello Experts,

It's been a long time since I've had to create a VFP EXE from scratch.  I'm doing this for a friend and need a quick solution. . .

The program, which consists of a prg and an scx file, runs great in VFP.  When  I compile it into an EXE and run it on my dev computer, it makes a tone and doesn't show anything.

I have a project that has start.prg as the main program.

My start.prg shows:
set talk off
on shutdown do close
do form TextChange
read events

My TextChange form has the following properties set:
Desktop is True
ShowWindow is 2 (as top level form)

the close.prg has:
clear events

The TextChange.scx form has one button that'll crunch some data if the user clicks it.  To get out of the program, they merely click the close (X) in the top left of the window and it closes the program.  The thing is, in the EXE, I never see the TextChange.scx form.  I double-click on the EXE and here a little bonk and that's it.


Avatar of Olaf Doschke
Olaf Doschke
Flag of Germany image

Is th start.prg set as the main file of the pjx? Or is the form set as the main file? That is one wrong setting that could cause the bahvior you describe. Otherwise I see you have a read events, the form is top level and desktop, should work. Perhaps try with _screen.vsible = .t. and see if the form then shows up within the screen, then there may be something in load, the de or init of the form changing it to be a "normal" form living in the screen.

Bye, Olaf.
Avatar of jruhe


Start.prg is the main program.  _Screen.visible=.t. (with changing the ShowWindow to 1) yields the same result.  The form has no code at all except under the only object, the button on the form.

Anything else you can think of would be greatly appreciated!

It seems your program does not start at all...

Place following command at the start.prg beginning:

WAIT WINDOW "I've started..."

Other observation could be to look at running processes in Task Manager.
You hear a "bonk". That's typically due to an error message. Look behind the windows explorer perhaps. The runtime files could be missing and you only get an error message saying so.

Bye, Olaf.
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jruhe


That's what it was--an errant dll.

Thanks very much!
You are welcome but you should rather split points because Olaf answered your question when I've been searching for a web link.
Avatar of jruhe


Hmmm.  Although I appreciate Olaf''s effort, your answer was the correct one.  That's an interesting question (I haven't asked many questions, and they've been slam-dunk or certainly split in the past).  Is it more appropriate to give the points to the person who answered correctly, or all the people who answered?  I'll re-assign if you really think it's best that you split them.
I don't mind. pcelba has given you a link to the runtime files additionally to just telling you it might be the runtime files missing.

Bye, Olaf.
OK, thanks Olaf.
One more advice: Test an exe on the development computer first. Where VFP is installed the runtimes are installed too. You can see the exe works and then it's quite easy to see and say it's the runtimes missing, when testing on another computer.

Bye, Olaf.
Avatar of jruhe


Thanks guys--I really appreciate it.  Actually, I found out that the computer that I was using had some kind of copied version of VFP on it, although my colleague had a legal version of the product.  So not even the dev computer had the runtimes on it!  I tested it on one of my old computers that had a good copy on it and it worked, so we reinstalled on the "dev" computer and no problem!  It worked great.
I see.

Yes, VFP works, if you simply copy the program files folder of foxpro, the runtimes are under \Common Files\microsoft shared\VFP, you don't need them to work inside the IDE though. As a VFP license is bound to a user and not a computer or cpu that's a great way to always have a vfp copy with you, it also works from a USB pen drive.

Bye, Olaf.

Avatar of jruhe


Wow!  Thanks Olaf--that's good to know!