BOOL AFXAPI AfxOleCanExitApp( );
#include <afxdisp.h>
Return Value
Nonzero if the application can exit; otherwise 0.
Remarks
Indicates whether the application can terminate. An application should not terminate if there are outstanding references to its objects. The global functions AfxOleLockApp and AfxOleUnlockApp increment and decrement, respectively, a counter of references to the application’s objects. The application should not terminate when this counter is nonzero. If the counter is nonzero, the application’s main window is hidden (not destroyed) when the user chooses Close from the system menu or Exit from the File menu. The framework calls this function in CFrameWnd::OnClose.
See Also AfxOleLockApp, AfxOleUnlockApp