Thanks.
Gabriel.
Get the document, and call OnCloseDocument(). If you have the frame or
the view, you can get the document very easily.
T.J. Mullen
OLDI Software
You can simulate what happens when the user selects the "File, Close" menu
command using this line of code:
AfxGetMainWnd()->PostMessage( WM_COMMAND, ID_FILE_CLOSE );
This will close the currently "active" document.
If you want to close a specific document, use code like this:
CYourDoc* pDoc;
// make pDoc point to the document you want to close
pDoc->OnCloseDocument();
You will find additional details in FAQ 2.12 of "The MFC Answer Book": How
do I programmatically close a document? You can find screen shots and a
sample program at
<http://www.mfcfaq.com/mfc_answer_book/contents/faq02-12.htm>.
Find more than 130 similar and advanced tips and techniques in "The MFC
Answer Book: Solutions for Effective Visual C++ Applications". For
additional details, surf to <http://www.mfcfaq.com>.
Good luck!
- Eugene Kain
Author of "The MFC Answer Book: Solutions for Effective Visual C++
Applications" (Addison-Wesley, 1998).
Visit the book's web site at <http://www.mfcfaq.com>
Get the best prices at
<http://www.amazon.com/exec/obidos/ASIN/0201185377/mfcfaqcom>
Gabriel Zerbib wrote in message <371A2114...@usa.net>...
Regards:
vinod kumar k.l
Gabriel Zerbib <gabriel...@usa.net> wrote in message
news:371A2114...@usa.net...