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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Build standalone exe problem! 2

Status
Not open for further replies.

Paco75

Programmer
Oct 11, 2001
239
US
Hi,

Im trying to build a .exe file but when i run the .exe file it instantly close... no error message! When i build it as a .app everything work fine.

i have these files in my app folder:
* vfp9t.dll
* vfp9r.dll
* vfpRENU.dll
* MSVCR71.dll
* FOXUSER.DBF
* FOXUSER.FPT

is there anything else to do to?
 
See READ EVENTS in the help file.

Your startup program should initialize variables and environment and then issue READ EVENTS.

When your user chooses to exit the application, it should CLEAR EVENTS and allow processing to finish normally.
 
Still not working... now it opens a empty visual foxpro screen and im stuck in a "Cant Quit Visual Foxpro" only way to get out is using task manager and kill process.

i created a very basic project to test it. A window with a quit button.

*** in the form load
Code:
READ EVENTS

*** in the button click event
Code:
CLEAR EVENTS 
thisForm.Release

 
Do NOT put READ EVENTS in a form method, because that method never ends. READ EVENTS stops processing of any later code and waits for user input.

Your main program should look something like this:

DO yourmenu.mpr
** POSSIBLY do form mainform
READ EVENTS

Your menu's QUIT should Clear Events.

Do not try to establish VFP's event loop inside a form's event methods. You end up messing up the form and VFP both.
 
Thanks it works

i created a .prg to launch my form instead and it works fine
Code:
do form form1
READ EVENTS

but i was thinking i would get rid of the background VFP screen by creating a .exe file... seems not. I guess there is no way to get rid of it?
 
i also found that its good to put

Code:
ON SHUTDOWN CLEAR EVENTS
at begining of program and
Code:
ON SHUTDOWN
after CLEAR EVENTS

this avoid the "Cannot close visual foxpro" infinite loop... just in case someone is stuck with this
 
but i was thinking i would get rid of the background VFP screen by creating a .exe file... seems not. I guess there is no way to get rid of it?

Create a text file called CONFIG.FPW and add this line to it:

SCREEN=OFF

Include the file in your project (Other tab, text files).

IMPORTANT NOTE: Your form *must* be a top level form (ShowWindow=2) or it will display in the hidden screen and be invisible.
 
Im having a little proble with display of forms since im in a standalone exe. The forms seem to freeze sometime but i discovered that they only not repainting correctly... when i move the mouse the form repaint itself.

Someone had this problem before? It is also a litle slower...
 
I found the problem. My childs forms were Modal and Showwindow = 2-As Top Level form...

I set them to Modal, Showwindow = 1-In Top Level form and set Desktop=.T.

Now performance is ok and repaint is ok too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top