I have an MFC MDI Application and I am trying to implement Automation with it. I am trying to create a RemoveDocument. How is that done? OnCloseDocument is causing problems. Is there a "standard" for doing that?
A:
You could just send a WM_CLOSE message to the Document's frame.
Edit: You could try sending it to the document's view instead. You can get all views that point to a given document by calling:
POSITION pos = pDoc->GetFirstViewPosition();
while( pos != NULL )
{
CView* pView = GetNextView( pos );
}
I "think" that should do the trick ...
Goz
2009-11-25 10:25:57
What if the document doesn't have a frame?? Tempalte->OpenDocumentFile(Path, FALSE); // <-- False means hidden
BabelFish
2009-11-30 16:19:14