Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fox Pro Executable 2

Status
Not open for further replies.

Pesteo

Programmer
Feb 3, 2003
17
0
0
US
I am working on a FoxPro Database project. The project is built and runs fine from the main screen. I built an application file, and that runs and works as desired. I build an executable, and when I double click on the execuatble, It opens the program, and automatically closes it. I have looked through my code on the main page and there are no calls to shutdown, or to a program that would do that. The only way to close the application from the main screen is to click on the exit button. I know this seems vague, but if you have any suggestions, it would be greatly appreciated.

Thanks....
 
Pesteo

Have you used a READ EVENTS somewhere? You would need to put one as the last thing when the application opens.

DO myMenu.mpr
READ EVENTS

or DO myForm.scx
READ EVENTS

P.S. When the appliaction exits you also need a CLEAR EVENTS.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Also, you can try to set the WindowType property of your main form to 1-Modal.
 
What did the Window Type property Modal do????
 
Pesteo

I suggested to put a READ EVENTS which in fact makes everything stop and wait for the user's input. The Modal window achives the same thing, but normally its used for a one-form application where the one form opens and waits for the user's input. You would normally use that in a lookup form where you want the user to input a value to search, and it also prevents the user to access any other forms and menu options. It is more limiting.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Pesteo - I am getting the same symptom - did you resolve this, I am keen to leverage your experience before I start trying stuff myself.

Thanks, Jim
 
Hi Jim,

Did you try what Mike Gagnon suggested. In fact that is the solution.

You have to code..

DO FORM myMainForm
READ EVENTS

In your myMainForm's unload event add the code,
CLEAR EVENTS.

The problems you are facing is because EVENT PROCESSING has not been initiated. :)


ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
I have added READ EVENTS as described, but the problem persists. i.e. I can run this as an app, I can run it as an exe (run after build) from within VFP8, but if I try to run it as an executable outside of VFP8 it flashes past and terminates.

My main is wofstart.prg

SET DATE TO british
DO wof.mpr
READ EVENTS

Rgds, Jim
 
s36e175

Unusual, but not unseen. The fact that it runs in VFP is normal, since it is using the VFP environment to run, which can be deceptive. I assume your app is within its own directory, if so, look for a file called config.fpw, if found, edit it in note pad, and see if you have a line "SCREEN=OFF", if so, star it out (or simply remove it).

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
SCREEN=OFF in config.fpw was indeed the problem.

All fixed now.

Thanks, Jim
 
Thank You, I have had this problem before. Another, it works most times is to activate a window with a read,deactivate and minimize. I use an exit window that gets reactivated on the quit option and asks are you sure. When this window is released. The exe shuts down.
This worked for me, but the 'READ EVENTS' and 'CLEAR EVENTS' works better.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top