Prev: Apology to Joe
Next: CMFCMenuBar as a context menu ?
From: SH on 26 Mar 2010 05:23 Hi everyone, I have some troubles with my application's toolbar. Please see some lines of code following: int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; if (!m_wndCommandBar.Create(this) || !m_wndCommandBar.InsertMenuBar(IDR_MAINFRAME) || !m_wndCommandBar.LoadToolBar(IDR_MAINFRAME) || !m_wndCommandBar.AddAdornments(dwAdornmentFlags) ) { TRACE0("Failed to create CommandBar\n"); return -1; // fail to create } m_wndCommandBar.SetBarStyle(m_wndCommandBar.GetBarStyle() | CBRS_SIZE_FIXED); return 0; } My application works well with Windows Mobile 5.0 (either Pocket PC device or Pocket PC emulator). But now I want to try with Windows Mobile 6 Standard Pocket PC Device, it doesn't work any more. there is some errors on the Pocket PC as following: "Failed to create empty document." I found out that error is in a ine: "!m_wndCommandBar.LoadToolBar(IDR_MAINFRAME)" and when I commented out this line, this application works but, the toolbar disappears. I guess the problem come form the different between Windows mobile 5 and windows mobile 6, but I don't know how to fix it. Is any one can help me please! Best regards!
From: Tom Serface on 26 Mar 2010 12:24 Can you debug into the functions and see where it is failing? Maybe that would give you some indication. Tom "SH" <SH(a)discussions.microsoft.com> wrote in message news:370C4246-8B68-457C-B44B-FF10C4171979(a)microsoft.com... > Hi everyone, > I have some troubles with my application's toolbar. Please see some lines > of > code following: > int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) > { > if (CFrameWnd::OnCreate(lpCreateStruct) == -1) > return -1; > if (!m_wndCommandBar.Create(this) > || !m_wndCommandBar.InsertMenuBar(IDR_MAINFRAME) > || !m_wndCommandBar.LoadToolBar(IDR_MAINFRAME) > || !m_wndCommandBar.AddAdornments(dwAdornmentFlags) > ) > { > TRACE0("Failed to create CommandBar\n"); > return -1; // fail to create > } > m_wndCommandBar.SetBarStyle(m_wndCommandBar.GetBarStyle() | > CBRS_SIZE_FIXED); > return 0; > } > > My application works well with Windows Mobile 5.0 (either Pocket PC device > or Pocket PC emulator). But now I want to try with Windows Mobile 6 > Standard > Pocket PC Device, it doesn't work any more. there is some errors on the > Pocket PC as following: > "Failed to create empty document." > I found out that error is in a ine: > "!m_wndCommandBar.LoadToolBar(IDR_MAINFRAME)" > and when I commented out this line, this application works but, the > toolbar > disappears. > I guess the problem come form the different between Windows mobile 5 and > windows mobile 6, but I don't know how to fix it. > Is any one can help me please! > Best regards! > > >
|
Pages: 1 Prev: Apology to Joe Next: CMFCMenuBar as a context menu ? |