Hope somebody can help in solving this issue:
I have a non-modal forms, which are activated by clicking on a menu. All of these forms contain a command button that when clicked call a modal form which contains a grid that is used for record lookup. The modal form is passed a parameter that tells it the name of the file from where to pull records and returns the key of the record selected by the user to the calling form.
Now when i click the "main" close button, meaning by "main" close button the one that closes the application and returns to Windows, i get the following message:
"Cannot clear object in use", the error occurs on the main program where i have the following:
do mainmenu.prg
ON SHUTDOWN DO EXITPROC
Read Events
PROC EXITPROC
clear events
clear all
quit
ENDPROC
Curiously enough, if I click the "main" close button while in any other form, the application exits without problems and returns to Windows. That is, the error only happens on the Modal Forms called from other forms. Setting the _screen.activeform.closable = .f. and forcing the user to close the app by choosing exit from the file menu does not solve the problem because modal forms deactivate the main menu.
I have a non-modal forms, which are activated by clicking on a menu. All of these forms contain a command button that when clicked call a modal form which contains a grid that is used for record lookup. The modal form is passed a parameter that tells it the name of the file from where to pull records and returns the key of the record selected by the user to the calling form.
Now when i click the "main" close button, meaning by "main" close button the one that closes the application and returns to Windows, i get the following message:
"Cannot clear object in use", the error occurs on the main program where i have the following:
do mainmenu.prg
ON SHUTDOWN DO EXITPROC
Read Events
PROC EXITPROC
clear events
clear all
quit
ENDPROC
Curiously enough, if I click the "main" close button while in any other form, the application exits without problems and returns to Windows. That is, the error only happens on the Modal Forms called from other forms. Setting the _screen.activeform.closable = .f. and forcing the user to close the app by choosing exit from the file menu does not solve the problem because modal forms deactivate the main menu.