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

When Closing the top level form of my app; foxpro remains open.

Status
Not open for further replies.

rlw1839

Programmer
Sep 10, 2002
18
US
I created a simple application using the application wizard in VFP 6. and compiled it into an .exe. The app_topform is set as the top-level form and windowstate is maximized. The form comes up, I login; everything's fine.

The problem: when I quit from the application the topform closes but instead of going back to the windows desktop, foxpro has been openned; is still open and I'm sitting in the command box. I've done applications before using the application wizard but I cannot remember what I did to prevent foxpro saying open after closing the top/main form of the app.

 
If it is an exe, is there anything in the destroy event of app_topform that tells VFP to quit? Just closing the form won't quit VFP. I've got the line CLEAR EVENTS in the destroy event of my top-level form.


Hope that helps,

Stewart
PS If you want to get the best response to a question, please check out FAQ184-2483 first.
 
The app is compiled as an .exe.

I put CLEAR EVENTS in the destroy event of my top-level form and this had no effect; still the open foxpro after the form is destroyed.

The VFP application wizard creates a startup program which I included below. I put a wait window at the end of this startup program; When it appears there is no sign of an open foxpro; when I close the wait window up pops the foxpro desktop (1/2 screen). It seems that VFP is openning after the .exe closes?????




* STOCK_APP.PRG

* This file is a generated, framework-enabling component
* created by APPBUILDER
* (c) Microsoft Corporation


* Framework-generated application startup program
* for C:\APPS\STOCK\STOCK Project

#INCLUDE [..\STOCK_APP.H]

IF TYPE([APP_GLOBAL.Class]) = "C" AND ;
UPPER(APP_GLOBAL.Class) == UPPER(APP_CLASSNAME)
MESSAGEBOX(APP_ALREADY_RUNNING_LOC,48, ;
APP_GLOBAL.cCaption )
IF VARTYPE(APP_GLOBAL.oFrame) = "O"
APP_GLOBAL.oFrame.Show()
ENDIF
RETURN

ENDIF

RELEASE APP_GLOBAL
PUBLIC APP_GLOBAL

LOCAL lcLastSetTalk, llAppRan, lnSeconds, loSplash
LOCAL ARRAY laCheck[1]

lcLastSetTalk=SET("TALK")
loSplash = .NULL.
SET TALK OFF

#IFDEF APP_SPLASHCLASS

IF NOT EMPTY(APP_SPLASHCLASS)
loSplash = NEWOBJECT(APP_SPLASHCLASS, APP_SPLASHCLASSLIB)
IF VARTYPE(loSplash) = "O"
lnSeconds = SECONDS()
loSplash.Show()
ENDIF
ENDIF

#ENDIF

APP_GLOBAL = NEWOBJECT(APP_CLASSNAME, APP_CLASSLIB)

IF VARTYPE(APP_GLOBAL) = "O" ;
AND ACLASS(laCheck,APP_GLOBAL) > 0 AND ;
ASCAN(laCheck,UPPER(APP_SUPERCLASS)) > 0

APP_GLOBAL.cReference =[APP_GLOBAL]
APP_GLOBAL.cFormMediatorName = APP_MEDIATOR_NAME

#IFDEF APP_CD
APP_CD
#ENDIF

#IFDEF APP_PATH
APP_PATH
#ENDIF

#IFDEF APP_INITIALIZE
APP_INITIALIZE
#ENDIF

IF VARTYPE(loSplash) = "O"

IF SECONDS() < lnSeconds + APP_SPLASHDELAY
=INKEY(APP_SPLASHDELAY-(SECONDS()-lnSeconds),"MH")
ENDIF

loSplash.Release()
loSplash = .NULL.

ENDIF

RELEASE laCheck, loSplash, lnSeconds

IF NOT APP_GLOBAL.Show()

IF TYPE([APP_GLOBAL.Name]) = "C"
MESSAGEBOX(APP_CANNOT_RUN_LOC,16, ;
APP_GLOBAL.cCaption )
APP_GLOBAL.Release()
ELSE
MESSAGEBOX(APP_CANNOT_RUN_LOC,16)
ENDIF

ELSE
llAppRan = .T.
ENDIF


IF TYPE([APP_GLOBAL.lReadEvents]) = "L"

IF APP_GLOBAL.lReadEvents
* the Release() method was not used
* but we've somehow gotten out of READ EVENTS...
APP_GLOBAL.Release()
ENDIF
ELSE
RELEASE APP_GLOBAL
ENDIF

ELSE

MESSAGEBOX(APP_WRONG_SUPERCLASS_LOC,16)
RELEASE APP_GLOBAL

ENDIF

IF lcLastSetTalk=="ON"
SET TALK ON
ELSE
SET TALK OFF
ENDIF

IF TYPE([APP_GLOBAL]) = "O"
* non-read events app
RETURN APP_GLOBAL
ELSE
wait window "app global is no more "
RETURN llAppRan
ENDIF
 
An icon from the desktop. That's the problem!!! I'm not just calling the .exe; I'm calling VFP first. DAH!!!

Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top