Change text on PocketPC CCeCommandBar items

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi.

I have been trying for quite some time now to be able to dynamically
build or modify a commandbar containing a menubar ang toolbar. More
spesifically, I want to change the text on some of the buttons in the
menubar, both on the main menu and on items in a submenu (popup).

This is the code I use to build the original commandbar, which works
great:

// Building the command bar.
m_pCommandBar = new CCeCommandBar();
m_pCommandBar->Create(this);
CMenu* pMenu = m_pCommandBar->InsertMenuBar(IDR_MENUBAR);
m_pCommandBar->LoadToolBar(IDR_TOOLBAR);
::DrawMenuBar(GetSafeHwnd());

The parent / main class is a CProperty***, and this is all in MFC.

As I said, I have searched quite extensively on the net and in the
help docs, but all I find are fragments of different ways of doing
this, and none of them work.

Could someone please post some hint or code to how I can modify the
text on the menubar part of my commandbar?

Also, if it is easier to build the commandbar in code, and not using
resources (InsertMenuBar()), please let me know. I have not found a
way to do this yet.

Thanks, Ole-Johan Ellingsen

.


Quantcast