CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: PumpMessage

Threaded View

  1. #1
    Join Date
    Feb 2005
    Location
    Israel
    Posts
    1,475

    PumpMessage

    I have this code in VC6 MFC:
    Code:
    BOOL CSimEngineApp::PumpMessage()
    {
    	ASSERT_VALID(this);
    
    	//if (!::PeekMessage(&m_msgCur, NULL, NULL, NULL, PM_REMOVE))
    	if (!::PeekMessage(&m_lastSentMsg, NULL, NULL, NULL, PM_REMOVE))
    	{
    		return TRUE;
    	}
    
    
    	if (m_msgCur.message == WM_QUIT)
    	{
       #ifdef _DEBUG
    		if (afxTraceFlags & traceAppMsg)
    			TRACE0("CWinThread::PumpMessage - Received WM_QUIT.\n");
    		m_nDisablePumpCount++; // application must die
    			// Note: prevents calling message loop things in 'ExitInstance'
    			// will never be decremented
    #endif
    		return FALSE;
    	}
    
    #ifdef _DEBUG
    	if (m_nDisablePumpCount != 0)
    	{
    		TRACE0("Error: CWinThread::PumpMessage called when not permitted.\n");
    		ASSERT(FALSE);
    	}
    #endif
    
    
    	// process this message
    	if (m_msgCur.message != WM_KICKIDLE && !PreTranslateMessage(&m_msgCur))
    	{
    		::TranslateMessage(&m_msgCur);
    		::DispatchMessage(&m_msgCur);
    	}
    	return TRUE;
    }
    I am trying to use this code in 2005, but it shouts that m_msgCur and m_nDisablePumpCount are not declared. Did anyone solve this?
    Last edited by jhammer; May 17th, 2006 at 09:16 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured