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 » Creating Popup Menu Collapse All
Subject Author Date
Nilesh Yeolekar May 30, 2007 - 4:39 AM

I have a code CMenu tempCmenu;
tempCmenu.CreatePopupMenu();
tempMenu.AppendMenu(). //Append various menus depending on conditions...
popupMenu.TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,
point.x, point.y, this);

Now, I m using CExtPopupMenuWnd tempMenu;
tempMenu.CreatePopupMenu(AfxGetApp()->GetMainWnd()->m_hWnd);
tempMenu.ItemInsertCommand();
popupMenu.TrackPopupMenu(0, point.x, point.y);

By using this, When I run the application, the application stops responding.
I cant use LoadMenu() since the menus are created on the fly.

Is this the correct way?

Also, I m not using any Prof UI rregisterd messages like OnExtMenuPrepareLevel etc.

Technical Support May 30, 2007 - 1:10 PM

You should create any objects of the CExtPopupMenuWnd class as dynamic C++ objects using the new operator. The Prof-UIS pop-up menus delete themselves automatically. We guess this is the source of the problem in your project.