Click here to Skip to main content
15,888,984 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: From camera to AVI file - how to.in C++ Pin
«_Superman_»19-Jul-09 16:30
professional«_Superman_»19-Jul-09 16:30 
GeneralRe: From camera to AVI file - how to.in C++ Pin
Vaclav_19-Jul-09 16:45
Vaclav_19-Jul-09 16:45 
Questionhelp me Pin
sarroya19-Jul-09 7:05
sarroya19-Jul-09 7:05 
AnswerRe: help me Pin
Iain Clarke, Warrior Programmer19-Jul-09 7:57
Iain Clarke, Warrior Programmer19-Jul-09 7:57 
Questionpopup menu Pin
transoft19-Jul-09 7:00
transoft19-Jul-09 7:00 
AnswerRe: popup menu Pin
Iain Clarke, Warrior Programmer19-Jul-09 7:59
Iain Clarke, Warrior Programmer19-Jul-09 7:59 
GeneralRe: popup menu Pin
transoft19-Jul-09 9:42
transoft19-Jul-09 9:42 
AnswerRe: popup menu Pin
Randor 19-Jul-09 11:06
professional Randor 19-Jul-09 11:06 
transoft wrote:
I can not use "LoadMenu" for popupmenu? How can I fix?


CreatePopupMenu has already attached an HMENU handle to your CMenu object. You cannot attach a second menu like this. You can use CreatePopupMenu or LoadMenu but not both of them on the same CMenu object.

I also recommend avoiding the new/delete and just create the object on the stack. There is no reason to thrash the heap.

Something like this:

CMenu pPopupMenu;
if(pPopupMenu.LoadMenu(MAKEINTRESOURCE(YOUR_RESOURCE_ID)))
{
	POINT pt;
	GetCursorPos(&pt);
	HMENU hmenuTrackPopup = GetSubMenu(pPopupMenu.m_hMenu, 0);
	TrackPopupMenu(hmenuTrackPopup, TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0,m_hWnd, NULL); 
}


Some MSDN documentation:
Using Menus[^]

Best Wishes,
-David Delaune
GeneralRe: popup menu Pin
transoft19-Jul-09 11:28
transoft19-Jul-09 11:28 
GeneralRe: popup menu [modified] Pin
Randor 19-Jul-09 13:00
professional Randor 19-Jul-09 13:00 
QuestionHow to stop popup menu from closing? Pin
z33z19-Jul-09 6:27
z33z19-Jul-09 6:27 
AnswerRe: How to stop popup menu from closing? Pin
Iain Clarke, Warrior Programmer19-Jul-09 8:04
Iain Clarke, Warrior Programmer19-Jul-09 8:04 
GeneralRe: How to stop popup menu from closing? Pin
z33z19-Jul-09 10:25
z33z19-Jul-09 10:25 
GeneralRe: How to stop popup menu from closing? Pin
z33z19-Jul-09 11:43
z33z19-Jul-09 11:43 
GeneralRe: How to stop popup menu from closing? Pin
Iain Clarke, Warrior Programmer19-Jul-09 20:38
Iain Clarke, Warrior Programmer19-Jul-09 20:38 
QuestionBN_CLICKED not sent to parent. (Button control) Pin
Netc19-Jul-09 3:57
Netc19-Jul-09 3:57 
AnswerRe: BN_CLICKED not sent to parent. (Button control) Pin
Iain Clarke, Warrior Programmer19-Jul-09 8:07
Iain Clarke, Warrior Programmer19-Jul-09 8:07 
AnswerRe: BN_CLICKED not sent to parent. (Button control) Pin
Netc19-Jul-09 12:59
Netc19-Jul-09 12:59 
GeneralRe: BN_CLICKED not sent to parent. (Button control) Pin
Iain Clarke, Warrior Programmer19-Jul-09 20:39
Iain Clarke, Warrior Programmer19-Jul-09 20:39 
QuestionProgram Deployment Pin
Bram van Kampen18-Jul-09 15:00
Bram van Kampen18-Jul-09 15:00 
AnswerRe: Program Deployment Pin
Rick York18-Jul-09 16:50
mveRick York18-Jul-09 16:50 
QuestionMFC Functions Pin
sidkraft18-Jul-09 14:07
sidkraft18-Jul-09 14:07 
AnswerRe: MFC Functions Pin
CPallini18-Jul-09 21:16
mveCPallini18-Jul-09 21:16 
QuestionIs there any way to convert resource name to resource id? Pin
transoft18-Jul-09 11:51
transoft18-Jul-09 11:51 
AnswerRe: Is there any way to convert resource name to resource id? Pin
Stuart Dootson18-Jul-09 13:20
professionalStuart Dootson18-Jul-09 13:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.