Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why on shutdown program is not called?
Message
De
03/08/2010 11:03:11
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01474941
Message ID:
01474970
Vues:
46
>>>>>Hi everybody,
>>>>>
>>>>>I have these commands in the main program of the application:
>>>>>
>>>>>do mainmenu.mpr
>>>>>on shutdown do shutdownprogram
>>>>>
>>>>>read events
>>>>>
>>>>>I put assert command into shutdown program. However, it's not being called when I try to close the application in IDE by clicking on the x of the screen.
>>>>>What is it called then and why this program is not called?
>>>>>
>>>>>Thanks in advance.
>>>>
>>>>
>>>>Maybe somewhere you cleared on shutdown?
>>>>
>>>>How about:
>>>>
>>>>do mainmenu.mpr
>>>>on shutdown do shutdownprogram
>>>>....
>>>>read events
>>>>WAIT WINDOW "Current shutdown: "+ON("shutdown")
>>>>
>>>
>>>This code (wait window) is never executed.
>>>
>>>Here is exactly what I have
>>>
>>> DO SomeManager_menu.mpr
>>>
>>>    ON SHUTDOWN DO mgr_click_shutdown
>>>    DO FORM Some_Toolbar			&&display toolbar
>>>    DO FORM BrowserForm NOREAD
>>>    DO FORM Data_Path NOREAD
>>>
>>>    USE IN SELECT('LOCKOUT')
>>>    oAppObj.PollLockout_Start()
>>>
>>>    READ EVENTS							&&this is where it all happens!
>>>    MESSAGEBOX("Current shutdown: "+ON("shutdown"))
>>>
>>>This messagebox is never displayed when I try to close the application with the close button.
>>
>>Of course it is never displayed - you need a CLEAR EVENTS for the program to continue after the READ EVENTS
>
>I put this code
>
>
>IF llStartApp
>  DECLARE INTEGER GetLastError IN kernel32
>  DECLARE INTEGER CloseHandle  IN kernel32 INTEGER hObject
>  DECLARE INTEGER CreateMutex  IN kernel32 INTEGER lpMutexAttributes, INTEGER lInitialOwner, STRING lpName
>  IF VARTYPE(oAppObj.oMutex.NAME) = "C"
>    MESSAGEBOX('Starting')
>    DO set_time WITH prefs.set_time, prefs.nosay_time
>    DO SomeManager_menu.mpr
>   ** put a bunch of messageboxes here as well
>  ...
>
>
>The application is started OK, but I see 0 messageboxes. Which probably means this code is never executed and I need to find out where exactly the startup code of the application is.

You'll have to debug it - supposing llStartApp is true - have a look at the mutex stuff [ IF VARTYPE(oAppObj.oMutex.NAME) = "C"]
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform