?
Hab's eben nochmal probiert, also jetzt funktionierts, aber ich weiß nicht, woran es gelegen hat.
Das ist der aufrufende Dialog:
MM_TabControl m_tbCtrl;
BOOL CNewComponent::OnInitDialog()
{
CDialog::OnInitDialog();
m_tbCtrl.InsertItem(0, "HM8012");
m_tbCtrl.InsertItem(1, "HM80XX");
m_tbCtrl.Initialisierung();
return TRUE; // return TRUE unless you set the focus to a control
// AUSNAHME: OCX-Eigenschaftenseite muss FALSE zurückgeben.
}
Und hier wird initialisiert:
void MM_TabControl::Initialisierung()
{
m_aktuelleSeite=0;
m_tabellenSeite[0]->Create(IDD_SEITE1, this);
m_tabellenSeite[1]->Create(IDD_SEITE2, this);
m_tabellenSeite[0]->ShowWindow(SW_SHOW);
m_tabellenSeite[1]->ShowWindow(SW_HIDE);
SetRec();
}
void MM_TabControl::SetRec()
{
CRect tabRec, itemRec;
int nX, nY, nXz, nYz;
GetClientRect(&tabRec);
GetItemRect(0, &itemRec);
nX=itemRec.left;
nY=itemRec.bottom+1;
nXz=tabRec.right-itemRec.left-1;
nYz=tabRec.bottom-nY-1;
m_tabellenSeite[0]->SetWindowPos(&wndTop, nX, nY, nXz, nYz, SWP_SHOWWINDOW);
for(int nZaehler=1; nZaehler < m_Seitennummern; nZaehler++)
{
m_tabellenSeite[nZaehler]->SetWindowPos(&wndTop, nX, nY, nXz, nYz, SWP_HIDEWINDOW);
}
}