Problem on inserting Menu into the dialog 
Author Message
 Problem on inserting Menu into the dialog

I am fail to add the menu using CCeCommandBar, but success with using
SHCreateMenuBar. Would anyone please tell me why?

Code Segment 1:
CCeCommandBar *pCommandBar = (CCeCommandBar*)m_pWndEmptyCB;
pCommandBar->InsertMenuBar(IDR_MENUBAR);

Code Segment 2:
SHMENUBARINFO info;
info.cbSize = sizeof(info);
info.hwndParent = m_hWnd;
info.dwFlags = 0;
info.nToolBarId = IDR_MENUBAR;
info.hInstRes = ::AfxGetInstanceHandle();
info.nBmpId = 0;
info.cBmpImages = 0;
SHCreateMenuBar(&info);

Codes reference link:
http://www.*-*-*.com/

Thanks!
Stephen



Wed, 09 Feb 2005 09:52:33 GMT  
 Problem on inserting Menu into the dialog
Hi

have you tried the sample application from that article? It works fine. The
common mistake connected with the first approach is declaring m_pWndEmptyCB
in the dialog class. You should not add m_pWndEmptyCB member to your dialog
class; this member is declared in the base class (CDialog).

--
Yaroslav Goncharov
Smartphone Developer Network
www.smartphonedn.com


Quote:
> I am fail to add the menu using CCeCommandBar, but success with using
> SHCreateMenuBar. Would anyone please tell me why?

> Code Segment 1:
> CCeCommandBar *pCommandBar = (CCeCommandBar*)m_pWndEmptyCB;
> pCommandBar->InsertMenuBar(IDR_MENUBAR);

> Code Segment 2:
> SHMENUBARINFO info;
> info.cbSize = sizeof(info);
> info.hwndParent = m_hWnd;
> info.dwFlags = 0;
> info.nToolBarId = IDR_MENUBAR;
> info.hInstRes = ::AfxGetInstanceHandle();
> info.nBmpId = 0;
> info.cBmpImages = 0;
> SHCreateMenuBar(&info);

> Codes reference link:
> http://www.pocketpcdn.com/qa/dialogmenu.html

> Thanks!
> Stephen



Fri, 11 Feb 2005 20:55:58 GMT  
 Problem on inserting Menu into the dialog
Hi

I have tried the small application, it work fine.
But it does work when I apply to my application.
I haven't declare m_pWndEmptyCB.

Regards
Stephen


Quote:
> Hi

> have you tried the sample application from that article? It works fine.
The
> common mistake connected with the first approach is declaring
m_pWndEmptyCB
> in the dialog class. You should not add m_pWndEmptyCB member to your
dialog
> class; this member is declared in the base class (CDialog).

> --
> Yaroslav Goncharov
> Smartphone Developer Network
> www.smartphonedn.com



> > I am fail to add the menu using CCeCommandBar, but success with using
> > SHCreateMenuBar. Would anyone please tell me why?

> > Code Segment 1:
> > CCeCommandBar *pCommandBar = (CCeCommandBar*)m_pWndEmptyCB;
> > pCommandBar->InsertMenuBar(IDR_MENUBAR);

> > Code Segment 2:
> > SHMENUBARINFO info;
> > info.cbSize = sizeof(info);
> > info.hwndParent = m_hWnd;
> > info.dwFlags = 0;
> > info.nToolBarId = IDR_MENUBAR;
> > info.hInstRes = ::AfxGetInstanceHandle();
> > info.nBmpId = 0;
> > info.cBmpImages = 0;
> > SHCreateMenuBar(&info);

> > Codes reference link:
> > http://www.pocketpcdn.com/qa/dialogmenu.html

> > Thanks!
> > Stephen



Sat, 12 Feb 2005 09:50:36 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Inserting menu items into a dialog's system menu

2. How to insert a menu resource in a dialog box

3. Insert a menu into my dialog?

4. insert a user defined popup menu to the Mainframe menu

5. Inserting an ActiveX Control that uses a Dialog on a dialog

6. Problem with Menus on Modal Dialog Application in Win NT 4.0 SP3

7. Dialog Menu/Status bar problems

8. Dialog app with menus problem...

9. Problem with menu on dialog box

10. Problem with ON_UPDATE_COMMAND_UI in dialog-based menu

11. Dialog Box Menu Problems

12. Problem with OnUpdate for menu item in dialog box

 

 
Powered by phpBB® Forum Software