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 Empty popup menu Collapse All
Subject Author Date
Offer Har Mar 12, 2008 - 11:20 AM

Dear Support,

I would like to create an empty menu, but I get asserts from Prop-UIS.

Please check why it is impossible - I implement CExtPopupMenuWnd::g_nMsgPrepareMenu and add my own items, so I don’t know why I cannot have an empty menu.

What I do now is add a dummy item, and in OnExtMenuPrepare remove it... but this does not make sense.

Regards,
Ron.

Offer Har Mar 17, 2008 - 5:23 AM

But they don’t.... I get assert:
This is the assert place, if the menu is empty - ExtPopupMenuWnd.cpp line 10167 in TrackPopupMenu
This is the lines before it:

		||	( !::IsWindow( m_hWndCmdReceiver ) )
		)
		return FALSE;

//	if( !bSiteWasEmpty
//		|| CExtToolControlBar::g_bMenuTracking
//		|| bCaptureChanged
//		)
//	{
//		PassMsgLoop( CExtPopupBaseWnd::g_bEnableOnIdleCalls );
//		if( ! ::IsWindow(m_hWndCmdReceiver) )
//			return FALSE;
//	}
//	if( !_site.IsEmpty() )
//		return FALSE;

	ASSERT( m_bTopLevel ); <=== This is my assert when the menu is empty

Technical Support Mar 17, 2008 - 5:03 AM

Empty menus should work without any problems. Please ensure you have invoked the CExtPopupMenuWnd::CreatePopupMenu() (or CExtPopupMenuWnd::LoadMenu() or CExtPopupMenuWnd::UpdateFrom***()) method with a valid non-NULL HWND parameter.

Technical Support Mar 17, 2008 - 5:03 AM

Empty menus should work without any problems. Please ensure you have invoked the CExtPopupMenuWnd::CreatePopupMenu() (or CExtPopupMenuWnd::LoadMenu() or CExtPopupMenuWnd::UpdateFrom***()) method with a valid non-NULL HWND parameter.