|
-
August 13th, 2011, 08:49 PM
#1
[MFC MDI] How to activate a view programmatically and safely ?
I've developing MFC-MDI applications and this application has tabbed document style.
I want to activate each view programmatically and using CMainFrame::SetActiveView method like below.
void CMyView::OnShowWindow( BOOL bShow ... )
{
CView::OnShowWindow( bShow, ... );
CMainFrame *mf = (CMainFrame*)AfxGetMainWnd();
mf->SetActiveView(this);
}
This code makes a view active programatically but has a critical problem that the application pops up the error about the activation of the context when I close a document.
How can I solve this problem?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|