Professional UI Solutions
Site Map   /  Register


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 General Discussion » The check mark doesn't appear at the popup menu of CExtPopupMenuWnd Collapse All
Subject Author Date
Seung Cheol Lee May 15, 2008 - 6:15 AM


To change  the location of my application, I used the source of LanguageSwitcher.

To the popup menu, I used the below code.


CExtPopupMenuWnd * pPopup =  new CExtPopupMenuWnd;

CPoint posMouse;


VERIFY (pPopup->LoadMenu (GetSafeHwnd (), IDR_MENU9, true, true));

VERIFY (pPopup->TrackPopupMenu (0, posMouse.x, posMouse.y));


But the problem occured.

The check mark didn’t appear at the popup menu.

How to solve this problem.


Seung Cheol Lee May 16, 2008 - 2:39 AM

I have known  the method " pCmdUI->SetCheck (1)".

I found two problems.



VERIFY (pPopup->LoadMenu (GetSafeHwnd (), IDR_MENU9, true, false));

To use the upper code, chaging location didn’t work.



VERIFY(pPopup->LoadMenu (GetSafeHwnd (), IDR_MENU9, true, true));

To use the upper code, check mark didn’t appear.



And I’m going to make sample code with LanguageSwitcher, But I can’t compile.

Do you know the cause not to complie?

My location is korean.

Technical Support May 16, 2008 - 2:12 PM

Which Prof-UIS version are you using to compile the LanguageSwitcher sample and is it trial/full or freeware? Which errors are displayed in Visual Studio’s Output window?

Seung Cheol Lee May 16, 2008 - 8:32 PM

Compile specification is below

-       Prof-UIS version : 2.82 Full Version

-       OS : Windows Vista

-       IDE : Visual Studio 2005

-       Location : Korea


If the location of OS was korea, I could not compile the LanguageSwitcher sample.

But If the location of OS was English, I could compile.

Perhaps according to the location of OS, I thought that the result is different.


About the problem of context menu, I made a sample code. And attach to e-mail.

I compiled the sample source in english location.


Please could you confirm two problems.

Technical Support May 19, 2008 - 1:56 PM

This is known a bug of both Visual Studio 2005 and Visual Studio 2008. They are crashing when parsing .RC resource files containing texts on many languages. The crashes occur only if Windows locale is set to some complex language like Korean, Japanese or Chinese. The ProfUISDLL and LanguageSwitcher are such kind of projects containing resources on many languages. In the case of Prof-UIS, you should switch temporarily into English locale, compile all the required Prof-UIS DLL, return to Korean locale and continue development of your projects.

Seung Cheol Lee May 19, 2008 - 5:59 PM

Thank you for your answer.

And how to do about the check mark  problem of context menu.

I sent the e-mail attached sample code to you yesterday.


Seung Cheol Lee May 20, 2008 - 4:51 AM

I’m sorry.

I have solved the check mark problem of context menu.

I omitted the below code.


if (! g_CmdManager->UpdateFromMenu (pApp->m_pszProfileName, IDR_MENU9, true)) return false;



And I have a question.

What is the fourth parameter of pPopu->LoadMenu function?


VERIFY (pPopup->LoadMenu (GetSafeHwnd (), IDR_MENU9, true, false));





Technical Support May 20, 2008 - 12:26 PM

The popup menu commands are based on the command manager by default. I.e. menu command item does not contain neither icon nor text and uses command manager for querying a CExtCmdItem command description object which contains command parameters. If you insert menu commands using the CExtPopupMenuWnd::ItemInsert() or CExtPopupMenuWnd::LoadMenu()/CExtPopupMenuWnd::UpdateFromMenu() methods with the bNoRefToCmdMngr parameter set to false, the inserted menu commands will be based on the command descriptions in the command manager. The CExtPopupMenuWnd::LoadMenu()/CExtPopupMenuWnd::UpdateFromMenu() methods do automatic command manager updating from menu. If you are using some command identifier in the CExtPopupMenuWnd::ItemInsert() method invocation, you should preliminary register it in the command manager using g_CmdManager -> CmdAllocPtr( ... ).

But a popup menu also supports command items which are not based on the command manager. Such command items store their text strings and icons directly in its popup menu data and updated from menu resources "as is". You can use the CExtPopupMenuWnd::ItemInsertCommand() method and the CExtPopupMenuWnd::LoadMenu()/CExtPopupMenuWnd::UpdateFromMenu() methods with itsbNoRefToCmdMngr parameter set to true to initialize a Prof-UIS popup menu with command items which are not based on the command manager. Such menu commands are not updated through MFC’s command updating mechanism and that is why you can see the menu check boxes after updating the Prof-UIS popup menu from a menu resource using the bNoRefToCmdMngr parameter set to true.

Technical Support May 15, 2008 - 9:18 AM

Please add a command updating method for the menu command item with a check mark and invoke pCmdUI->SetCheck( 1 ); in it.