Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

c++, MFC!?


  • Please log in to reply

#1
t3ch

t3ch

    New Member

  • Member
  • Pip
  • 2 posts
Hi..
Im trying to make popup menu, i recv msg WM_RBUTTONDOWN in PreTranslatedMessage() then create that popup but when open new Dialog with DoModal() or Create() it crash it crash when Cancel it.. when destroy it...

BOOL CMFCTestDlg::PreTranslateMessage(MSG * pMsg)
{
	switch(pMsg->message)
	{
	case WM_RBUTTONDOWN:
  {
 	 POINT p;
 	 GetCursorPos(&p);
 	 
 	 HMENU hMenu = ::CreatePopupMenu();
 	 if (NULL != hMenu)
 	 {
    // add a few test items
    ::AppendMenu(hMenu, MF_STRING, 1, "Start Sniff");
    
    int sel = ::TrackPopupMenuEx(hMenu, 
   	 TPM_CENTERALIGN | TPM_RETURNCMD,
   	 p.x,
   	 p.y,
   	 m_hWnd,
   	 NULL);
    ::DestroyMenu(hMenu);
    
    if(sel == 1)
    {
                                        //
                                        //CSniff.DoModal();
                                        // OR 
   	 //CSniff.Create(IDD_SNIF);
   	 //CSniff.ShowWindow(1);
    }
 	 }
  }
	}

	return 0;//CDialog::PreTranslateMessage(pMsg);
}

So when im destroyng that dialog when is opened with popup it crash program... any help please :tazz:

Edited by t3ch, 11 July 2005 - 06:19 AM.

  • 0

Advertisements


#2
t3ch

t3ch

    New Member

  • Topic Starter
  • Member
  • Pip
  • 2 posts
U PEOPLE HERE ARE GeeKs '\0' :tazz::) lool
  • 0

#3
ratmilk

ratmilk

    Member

  • Member
  • PipPipPip
  • 151 posts
Lol dude, i don't think anyone around here knows :tazz:

How are you calling PreTranslateMessage??
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP