muze 0 Junior Poster in Training

hello guys.. I am trying to make a simple tab control dialog-based application. Well I succeeded to do so. But I am facing problem in recieving data. I have put an EditBox onto the dialog (used for the Tab Client Area) but it is not giving the values back. Here is what my main dialog (the container for CTabCtrl) looks like

void CAnotherTabCtrlDlg::OnOk()
{
    // TODO: Add your control notification handler code here

    CString str;
    CDialog *window= (CDialog*)&m_tabMyTabCtrl; //CMyTabCtrl m_tabMyTabCtrl: class derived from CTabCtrl

    CTabOne *tab;
    tab = (CTabOne*)window;
    str = tab->GetTabOneData(); // the tab: this is supposed to return the value from EditBox

    MessageBox(str);
    CDialogEx::OnOK();
}

Now here is what tab->GetTabOneData() looks like

CString CTabOne::GetTabOneData()
{
    CString strTabOneText;
    CDialogEx *dialog = (CDialogEx*)this;
    dialog->GetDlgItemTextW(IDC_EDIT, strTabOneText);
    return strTabOneText;
}

An empty messagebox is shown when I run the application. What can be the problem? Thanx for any input.