Click here to Skip to main content
15,900,461 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Property Pages Pin
Joan M5-May-03 6:06
professionalJoan M5-May-03 6:06 
GeneralRe: Property Pages Pin
De Nardis Andrea5-May-03 6:42
De Nardis Andrea5-May-03 6:42 
GeneralRe: Property Pages Pin
G. Steudtel5-May-03 6:11
G. Steudtel5-May-03 6:11 
QuestionHow to retrieve complete network path Pin
Ivano5-May-03 4:55
Ivano5-May-03 4:55 
AnswerRe: How to retrieve complete network path Pin
David Crow5-May-03 5:04
David Crow5-May-03 5:04 
GeneralRe: How to retrieve complete network path Pin
Ivano5-May-03 5:10
Ivano5-May-03 5:10 
GeneralRe: How to retrieve complete network path Pin
David Crow5-May-03 5:14
David Crow5-May-03 5:14 
GeneralExecution problem with TrackPopupMenu, help !!! Pin
flybird5-May-03 4:53
flybird5-May-03 4:53 
here is my code:

In AppView.cpp :
----------------

void CTestApplicationView::OnContextMenu(CWnd* pWnd, CPoint point)
{
CMenu Menu;
// Store popup point, and convert to client coordinates
// for the drawing functions.
Menu.LoadMenu( IDR_CONTEXTMENU );
CMenu* pPopup = Menu.GetSubMenu( 0 );
pPopup->TrackPopupMenu( TPM_LEFTALIGN|TPM_RIGHTBUTTON,
point.x,
point.y,
this );

}

when i right click mouse i got an execution error on
TrackPopupMenu:
--------------

BOOL CMenu::TrackPopupMenu(UINT nFlags, int x, int y,
CWnd* pWnd, LPCRECT lpRect)
{
ASSERT(m_hMenu != NULL); <---------- PROBLEM HERE

_AFX_THREAD_STATE* pThreadState = AfxGetThreadState();
HWND hWndOld = pThreadState->m_hTrackingWindow;
HMENU hMenuOld = pThreadState->m_hTrackingMenu;
pThreadState->m_hTrackingWindow = pWnd->GetSafeHwnd();
pThreadState->m_hTrackingMenu = m_hMenu;
BOOL bOK = ::TrackPopupMenu(m_hMenu, nFlags, x, y, 0,
pThreadState->m_hTrackingWindow, lpRect);
pThreadState->m_hTrackingWindow = hWndOld;
pThreadState->m_hTrackingMenu = hMenuOld;

return bOK;
}


Any ideas, cause I really don't understand why ...Cry | :((
GeneralRe: Execution problem with TrackPopupMenu, help !!! Pin
David Crow5-May-03 5:06
David Crow5-May-03 5:06 
GeneralRe: Execution problem with TrackPopupMenu, help !!! Pin
Hari Krishnan (Noida)5-May-03 21:45
Hari Krishnan (Noida)5-May-03 21:45 
General(Stupid?) vector problem Pin
david2625-May-03 4:35
david2625-May-03 4:35 
GeneralRe: (Stupid?) vector problem Pin
markkuk5-May-03 4:48
markkuk5-May-03 4:48 
Generalsend message from subclass to parent Pin
JensB5-May-03 3:36
JensB5-May-03 3:36 
GeneralRe: send message from subclass to parent Pin
Bartosz Bien5-May-03 3:49
Bartosz Bien5-May-03 3:49 
GeneralRe: send message from subclass to parent Pin
JensB5-May-03 4:02
JensB5-May-03 4:02 
GeneralRe: send message from subclass to parent Pin
Bartosz Bien5-May-03 4:13
Bartosz Bien5-May-03 4:13 
GeneralRe: send message from subclass to parent Pin
JensB5-May-03 4:33
JensB5-May-03 4:33 
GeneralRe: send message from subclass to parent Pin
Renjith Ramachandran5-May-03 4:29
Renjith Ramachandran5-May-03 4:29 
GeneralRe: send message from subclass to parent Pin
JensB5-May-03 20:03
JensB5-May-03 20:03 
GeneralHiding Application Pin
Member 2266405-May-03 3:22
Member 2266405-May-03 3:22 
GeneralRe: Hiding Application Pin
Joaquín M López Muñoz5-May-03 3:25
Joaquín M López Muñoz5-May-03 3:25 
GeneralRe: Hiding Application Pin
Member 2266405-May-03 3:58
Member 2266405-May-03 3:58 
GeneralRe: Hiding Application Pin
jmkhael5-May-03 4:20
jmkhael5-May-03 4:20 
GeneralRe: Hiding Application Pin
David Crow5-May-03 4:14
David Crow5-May-03 4:14 
GeneralRe: Hiding Application Pin
Joseph Dempsey5-May-03 6:09
Joseph Dempsey5-May-03 6:09 

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.