以前好心人muxinqionghuo1980对我说的代码我运行了可以在CTabCtrl控件中加入新页,
可是那只是在基于对话框的工程中。现在我在基于多文档的工程中不行;
我的多文档工程中新建了一个基于视类的对话框,又建了此基于视类对话框的窗体。
错误出现的:
void DDDview::OnInitialUpdate() 
{
CFormView::OnInitialUpdate();
m_tab.DeleteAllItems();
item.mask=TCIF_TEXT; item.pszText=" 数 据 记 录 ";
m_tab.InsertItem(0,&item);
item.pszText=" 数 据 操 作 ";
m_tab.InsertItem(1,&item);
    item.pszText=" 数 据 查 询 ";
m_tab.InsertItem(2,&item); CRect r;
m_tab.GetClientRect(&r);
dlg01.Create(IDD_DIALOG1,&m_tab);
         dlg02.Create(IDD_DIALOG2,&m_tab);
         dlg03.Create(IDD_DIALOG3,&m_tab); dlg01.SetWindowPos(NULL,0,20,r.right-5,r.bottom-20,SWP_SHOWWINDOW);
dlg02.SetWindowPos(NULL,0,20,r.right-5,r.bottom-20,SWP_SHOWWINDOW);
dlg03.SetWindowPos(NULL,0,20,r.right-5,r.bottom-20,SWP_SHOWWINDOW); // TODO: Add your specialized code here and/or call the base class

}
中,如果将
dlg01.Create(IDD_DIALOG1,&m_tab);
         dlg02.Create(IDD_DIALOG2,&m_tab);
         dlg03.Create(IDD_DIALOG3,&m_tab); dlg01.SetWindowPos(NULL,0,20,r.right-5,r.bottom-20,SWP_SHOWWINDOW);
dlg02.SetWindowPos(NULL,0,20,r.right-5,r.bottom-20,SWP_SHOWWINDOW);
dlg03.SetWindowPos(NULL,0,20,r.right-5,r.bottom-20,SWP_SHOWWINDOW);
去掉程序就正常,请问好心人们这是什么原因:::????