Write code for ‘Close All Documents’ menu command?


The ‘Close All Documents’ is a menu command that closes all the open documents and their views. This feature can be implemented by using two functions CWinApp::CloseAllDocuments( ) and SaveAllModified( ). The CloseAllDocuments( ) function destroys the currently active document objects without saving them. So we must first call SaveAllModified( ) function to save the documents. Following code shows how to implement this feature.

if ( AfxGetApp( ) -> SaveAllModified( ) )

AfxGetApp( ) -> CloseAllDocuments ( FALSE  ) ;

Subscribe / Share

It's very calm over here, why not leave a comment?

Leave a Reply




Categories

Powered by Yahoo! Answers