How do I add MenuBar for dialog based application in eVC++ 
Author Message
 How do I add MenuBar for dialog based application in eVC++

I made a dialogbox based applicaiton, now I need to show a MenuBar ( like
having File->Open, etc)  on dialogbox... can anyone suggest or point to soem
example on any link. ?

thnx in advance.
Ashish



Tue, 08 Feb 2005 06:53:21 GMT  
 How do I add MenuBar for dialog based application in eVC++
Put this in your OnInitDialog()

 CCeCommandBar *pCommandBar = (CCeCommandBar*)m_pWndEmptyCB;
 pCommandBar->InsertMenuBar(IDR_MENUMAIN); // update screen

(assumes your menu resource is called IDR_MENUMAIN)

--
Adam Goetz
Software Engineer
Ayr Data Systems



Tue, 08 Feb 2005 08:08:02 GMT  
 How do I add MenuBar for dialog based application in eVC++
I did this same but found it does not work with emulator as its x86 based. I
saw example only working for ARM based CPUs ..fI change thier CPU to x86 in
examples found at http://www.pocketpcdn.com/qa/dialogmenu.html then I see
somelinking erros specially for command bar.

I found another method works well for x86 architecture

// initDialog (){
....
 SHMENUBARINFO info;
 info.cbSize = sizeof(info);
 info.hwndParent = m_hWnd;
 info.dwFlags = 0;
 info.nToolBarId = IDR_MYMENUBAR;
 info.hInstRes = ::AfxGetInstanceHandle();
 info.nBmpId = 0;
 info.cBmpImages = 0;
 SHCreateMenuBar(&info);

return true;

Quote:
}

But I am surprised why couldn't I use first method. ..any comments
Gurus....;)

Ashish


Quote:
> Put this in your OnInitDialog()

>  CCeCommandBar *pCommandBar = (CCeCommandBar*)m_pWndEmptyCB;
>  pCommandBar->InsertMenuBar(IDR_MENUMAIN); // update screen

> (assumes your menu resource is called IDR_MENUMAIN)

> --
> Adam Goetz
> Software Engineer
> Ayr Data Systems



Tue, 08 Feb 2005 14:57:07 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Adding Another MFC Dialog to the Dialog base application

2. URGENT: adding ToolBars and StatusBars to a Dialog based application

3. How to add splash screen to a dialog-based application

4. Modifying menubar in eVC win32

5. Adding a simple line to dialog resource on eVC

6. problems adding menubar into dialog

7. dialog size in evc++ dialog editor not the same as size in pixels on device

8. Q:Adding multi dialog templates to CTabCtrl in base dialog

9. How to add 4 Icons in the title bar of a dialog/window in an eVC++ application.

10. Trapping Keystrokes in a Dialog Box or Dialog based application

11. Executing modal tabbed dialog from a dialog-based application

12. Positioning of dialogs in a dialog based application

 

 
Powered by phpBB® Forum Software