lowellnelson


I am a neophyte FoxPro programmer, AND I am new to forums such as this, so please bear with me.

I have been using a simple program utilizing a few free tables and some report forms, which I have been running within FoxPro. Now I want to generate an exe version for distribution to other computers in my area without installation of FoxPro at those locations. I have used the build command from the project manager, and it performs the build with no report of errors. An exe file results, as expected. The runtime files (vfp9r.dll, vfp9renu.dll, gdiplud.dll, and MSVCR71.dll) have all been copied into the same directory as the exe file. However, when the exe file is then clicked, nothing visible happens. The exe file appears in the Windows Task Manager list of processes, but not in the list of running applications. On the other hand, if the exe file is called from within the FoxPro command window, the exe application launches and runs perfectly.


Is there something obvious which I have done incorrectly

Thanks to anyone who can advise me.

Lowell



Re: build exe application

dni


You may create a formset or use a main.prg who is lauching the main form:

read events
do form <main>
Exit button of form must have clear events in click method.






Re: build exe application

dni

You may find a complete list of runtime files at:

http://fox.wikis.com/wc.dll Wiki~VFP9RuntimeFiles~VFP







Re: build exe application

Carl Warner

Most probably you are missing a READ EVENTS command in your code to add a wait state to the runtime application, but not required in the VFP development Command Window environment. But, I also feel as though you have no QUIT command in there or the process wouldn't still reside in the Task Manager. You must also provide a way out and maybe you do in another program location.

PRB: Application Appears Then Exits to Operating System
http://support.microsoft.com/default.aspx scid=kb;en-us;132697

QUIT Command
http://msdn.microsoft.com/library/en-us/dv_foxhelp9/html/eacb2c2d-0800-4769-8c06-fbdae38fedee.asp frame=true





Re: build exe application

Tamar E. Granor

Actually, you don't need a QUIT command in a VFP application. As long as something terminates the wait state, execution will continue through the main program to the end and when it finishes, VFP shuts down.

If you feel the need to use some terminating command, make it RETURN rather than QUIT, so that when you test in the IDE, VFP doesn't shut down.

Tamar




Re: build exe application

lowellnelson




Re: build exe application

lowellnelson

Thank you, Carl.

My application runs in perpetuity for staff to enter data at any time, and to print reports as needed. There is a menu option to close the application.

I think I am in need of some heavy-duty hand holding. I have been using applications which run within FoxPro for some time, but I have no experience generating exe applications. It was my expectation that, when an exe application is built and executed, those components of FoxPro required for it to run would be embedded into the application by the build command, and would be started when the exe application is executed. However, when I click on the exe application from my desktop, something runs in the "background," but nothing visible happens from the desktop. No FoxPro screen or window appears, and my application menus do not appear. I may be confused about some very basic concepts. If the prg version runs smoothly within the FoxPro screen and other windows generated by the program, should I expect the compiled exe application to generate and appear within those same screens and windows Or does run-time FoxPro have to be specifically called by the exe application Do my menus not appear because no window has been activated within which they can appear ...ie does the FoxPro screen need to be activated specifically by the exe application when no such commands are needed to run the prg version within FoxPro Or does my exe application stall because something generated by the build exe command hangs (even though no error messages are generated by the build) I tried inserting a "read events" command, without effect. Perhaps my placement in the program was wrong.

Thanks for any help!!





Re: build exe application

Alex Feldstein

>I think I am in need of some heavy-duty hand holding. I have been using applications which run within FoxPro for some time, but I have no experience generating exe applications. It was my expectation that, when an exe application is built and executed, those components of FoxPro required for it to run would be embedded into the application by the build command, and would be started when the exe application is executed.

>However, when I click on the exe application from my desktop, something runs in the "background," but nothing visible happens from the desktop. No FoxPro screen or window appears, and my application menus do not appear. I may be confused about some very basic concepts. If the prg version runs smoothly within the FoxPro screen and other windows generated by the program, should I expect the compiled exe application to generate and appear within those same screens and windows Or does run-time FoxPro have to be specifically called by the exe application Do my menus not appear because no window has been activated within which they can appear ...ie does the FoxPro screen need to be activated specifically by the exe application when no such commands are needed to run the prg version within FoxPro Or does my exe application stall because something generated by the build exe command hangs (even though no error messages are generated by the build) I tried inserting a "read events" command, without effect. Perhaps my placement in the program was wrong.

Your expectation is correct with a caveat. The runtimes and all needed is pulled into memory and referenced if you compiled it properly. What is different with other languages is that FoxPro needs a permamnent wait state (READ EVENTS) where it spends most of its time waiting for a menu option (or other trigger) to happen. Inside the IDE Fox itself does the wait state (so you see the command box). In a runtime environment you need to supply it yourself.

Basically the way you set it up is like this:

* Main.prg

* set up your environment

DO MainMenu && set up you nmenu system

DO MainForm && instantiate you main form

READ EVENTS

* clean up code goes here. Runs after a menu option or an EXIT button in a form issues a CLEAR EVENTS

See also ON SHUTDOWN

HTH





Re: build exe application

lowellnelson

Thanks Alex

I'm going to close this thread for now.