0
votes

I have a CTabView and add a tab like AddView(RUNTIME_CLASS(CMyView1), _T("View1"));. But how do I get a pointer to the created CMyView1 class created in the tab?

TIA!!

2
You probably need to customize add view to get view pointer.Santosh Dhanawade

2 Answers

1
votes

You can do something like this:

CMFCTabCtrl& MFCTabCtrl = YourTabView.GetTabControl();
for(int i = 0;i < MFCTabCtrl.GetTabsNum();++i)
{
    CMyView1* pView = (CMyView1*)MFCTabCtrl.GetTabWnd(i);
    ....
}
0
votes

Try to look at the MFC-MDI tab view Implementation, when you are talking about views, this is the easiest way.