0

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

df234987
  • 513
  • 2
  • 13

2 Answers2

1

You can do something like this:

CMFCTabCtrl& MFCTabCtrl = YourTabView.GetTabControl();
for(int i = 0;i < MFCTabCtrl.GetTabsNum();++i)
{
    CMyView1* pView = (CMyView1*)MFCTabCtrl.GetTabWnd(i);
    ....
}
Flaviu_
  • 1,285
  • 17
  • 33
0

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

xMRi
  • 14,982
  • 3
  • 26
  • 59