Archived

This topic is now archived and is closed to further replies.

Me again - Windows message handler

This topic is 5150 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Could anyone explain to me why this code doesn''t work? void CBazCan2LoadDlg::mMainLoop() { // Enter the message loop MSG msg; ZeroMemory( &msg, sizeof(msg) ); while( msg.message != WM_CLOSE ) { // Show the window m_crender.UpdateWindow(); CBazCan2LoadDlg::UpdateWindow(); if( PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE ) ) { TranslateMessage( &msg ); DispatchMessage( &msg ); } else { mRender(); //Framerate - if 1 second has passed then show framerate //in FPS static box on dialog. FPS = FPS + 1; if (GetTickCount() - 1000 >= lasttime) { UpdateData(FALSE); FPS = 0; lasttime = GetTickCount(); } } } Cleanup(); CDialog::OnClose(); } Oh,and how do you do those code windows in this forum? thanks de_matt

Share this post


Link to post
Share on other sites
Okay, I think some more info would help - I didn''t explain that too good. Basically I''m using an MFC dialog box with a picture box on it. The picture box is the display window. Where should I put the windows message handler?

The actual problem is the program doesn''t exit. Could the problem be that the picture box window has the focus?

thanks

de_matt

Share this post


Link to post
Share on other sites