开发者

MFC Automation how to implement RemoveDocument OnCloseDocument

开发者 https://www.devze.com 2022-12-12 04:38 出处:网络
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

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 ...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号