>>>>>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
>>> DO FORM BrowserForm NOREAD
>>> DO FORM Data_Path NOREAD
>>>
>>> USE IN SELECT('LOCKOUT')
>>> oAppObj.PollLockout_Start()
>>>
>>> READ EVENTS
>>> 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