MFC Automation how to implement RemoveDocument OnCloseDocument
I have an MFC MDI Application and I am 开发者_StackOverflow社区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?
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 ...
精彩评论