CCeCommandBar isn't shown
-
PocketPC MFC application: when I create a child dialog, my Commandbar is not shown anymore. See example code. Thanks in advance for any help on this. I realy need a solution for this.
BOOL CHAS_PocketClientDlg::OnInitDialog() { CDialog::OnInitDialog(); SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon CenterWindow(GetDesktopWindow()); // center to the hpc screen CCeCommandBar *pCommandBar = (CCeCommandBar*)m_pWndEmptyCB; pCommandBar->LoadToolBar(IDR_TOOLBAR); pCommandBar->SetSizes(CSize(23,21), CSize(16,15)); //comment following 2 lines and everything works fine ASSERT(m_Dlg.Create(IDD_DLG)); //Child dialog, no border m_Dlg.ShowWindow(SW_SHOW); //dialog is shown correctly return TRUE; // return TRUE unless you set the focus to a control }
-
PocketPC MFC application: when I create a child dialog, my Commandbar is not shown anymore. See example code. Thanks in advance for any help on this. I realy need a solution for this.
BOOL CHAS_PocketClientDlg::OnInitDialog() { CDialog::OnInitDialog(); SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon CenterWindow(GetDesktopWindow()); // center to the hpc screen CCeCommandBar *pCommandBar = (CCeCommandBar*)m_pWndEmptyCB; pCommandBar->LoadToolBar(IDR_TOOLBAR); pCommandBar->SetSizes(CSize(23,21), CSize(16,15)); //comment following 2 lines and everything works fine ASSERT(m_Dlg.Create(IDD_DLG)); //Child dialog, no border m_Dlg.ShowWindow(SW_SHOW); //dialog is shown correctly return TRUE; // return TRUE unless you set the focus to a control }
Your child dialog is a
CDialog
-derived class? If it is, it should have its onw emptym_pWndEmptyCB
that overlaps the one you want to show (created inCHAS_PocketClientDlg::OnInitDialog
). So, if you want to show it, you must create it (using the same procedure) in the child as well.