Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个CTabView并添加一个标签,例如AddView(RUNTIME_CLASS(CMyView1), _T("View1"));. 但是如何获得指向CMyView1在选项卡中创建的已创建类的指针?
CTabView
AddView(RUNTIME_CLASS(CMyView1), _T("View1"));
CMyView1
蒂亚!!
你可以这样做:
CMFCTabCtrl& MFCTabCtrl = YourTabView.GetTabControl(); for(int i = 0;i < MFCTabCtrl.GetTabsNum();++i) { CMyView1* pView = (CMyView1*)MFCTabCtrl.GetTabWnd(i); .... }
尝试查看 MFC-MDI 选项卡视图的实现,当您谈论视图时,这是最简单的方法。