Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to close application when having a preview open?
Message
 
 
To
10/11/2005 10:08:47
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01067133
Message ID:
01067166
Views:
18
Putting the code to release the preview window at the bottom of the CleanUp procedure seems to solve the problem.

Thanks a lot.

Here is the new CleanUp code
LPARAMETERS tlForceShutDown

LOCAL lcOnShutdown

_screen.MousePointer = MOUSE_HOURGLASS

 
*-----------------------------------
*--- Close all applications forms
*-----------------------------------
IF NOT This.oForms.CloseAllForms(tlForceShutDown)
	RETURN .F.
ENDIF

*-----------------------------------------------------------------
*-- Close the entry in the user log 
*-----------------------------------------------------------------
This.LogUserActivity("Logout")

IF VARTYPE(This.oUserLogMgr) == 'O' AND ;
  NOT ISNULL(This.oUserLogMgr)
	This.oUserLogMgr.Release()
ENDIF

*-----------------------------------------------------------------
*-- Unlock any records the user may have open.
*-----------------------------------------------------------------
This.oRecordMgr.UnlockAll(This.cUserid)

IF VARTYPE(This.oRecordMgr) == 'O' AND ;
  NOT ISNULL(This.oRecordMgr)
	This.oRecordMgr.Release()
ENDIF

*-----------------------------------------------------------------
*-- Release the timer and run the parent code.
*-----------------------------------------------------------------
This.ReleaseDesktopTimer()

This.ReleaseAbstractFactory()
This.ReleaseDBCMgr()

*----------------------
*-- Restore the caption
*----------------------
_screen.Caption = This.cOldMainWindCaption
SET MESSAGE TO ""

*-------------------------------------
*-- Restore the setting of ON SHUTDOWN
*-------------------------------------
lcOnShutdown = This.cOldOnShutdown
ON SHUTDOWN &lcOnShutDown

This.ReleaseSplash()

This.ReleaseToolbar()

This.ShowVFPToolbars()

This.oErrorMgr = .NULL.
This.ReleaseMenu()

This.ReleaseDesktopImage()
This.ReleaseChildren()
This.ReleaseGlobalEnvironmentObj()

*--- If the Connection Manager exists, release it
IF TYPE("this.oConnectionMgr") == "O" AND !ISNULL(this.oConnectionMgr)
	This.oConnectionMgr.Release()
ENDIF

IF WEXIST('Report Designer')
    RELEASE WINDOWS 'Report Designer' && try to close report preview window 
ENDIF

CLOSE DATA ALL
CLEAR EVENTS

*--------------------------------------------------
*-- Indicates that the Cleanup method has already
*-- been run.
*--------------------------------------------------
This.lIsClean = .T.
_SCREEN.MousePointer = MOUSE_DEFAULT
CLEAR PROGRAM
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform