Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » CExtPopupMenuWnd::ItemInsert() no longer working Collapse All
Subject Author Date
Robert Webb Jul 15, 2010 - 8:55 PM

I just noticed that a feature has stopped working in our program.  Presumably due to a change in ProfUIS.  We have:



CExtPopupMenuWnd *menu;
VERIFY(menu->ItemInsert(FN_COPYBITMAP));

We do not have a CExtCmdItem associated with the ID for the item, nor do we need one.  Previously this worked and we could handle the message ourselves when it arrived.  Now we get an assertion in CExtPopupMenuWnd::ItemInsert() because there’s no CExtCmdItem.


We also add the item earlier to the system menu using good old ::AppendMenu(HMENU, ...).  I don’t know whether that previously gave ProfUIS what it needed to recognise this command later.


Any ideas?


Thanks,


Rob.

Technical Support Jul 16, 2010 - 4:29 AM

By default, command items in a Prof-UIS popup menu are based on command descriptions stored in the command manager. The CExtPopupMenuWnd::ItemInsert() method inserts such menu commands. But a popup menu also supports menu commands which are not based on the command manager and not updated htrough MFC’s command updating mechanism. Such menu items are inserted through the CExtPopupMenuWnd::ItemInsertCommand() method or through the CExtPopupMenuWnd::LoadMenu() and CExtPopupMenuWnd::UpdateFromMenu() methods invoked with the bNoRefToCmdMngr flag parameter set to true.

Robert Webb Jul 15, 2010 - 9:48 PM

I’ve found a fix for this by using:



VERIFY(menu->ItemInsert(FN_COPYBITMAP, -1, NULL, NULL, frame->m_hWnd));

Not sure what changed to require this, but no matter, now it works.


Thanks,


Rob.