Click here to Skip to main content
16,005,120 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MDI app doesn't close Pin
Alex Cutovoi14-Aug-07 8:33
Alex Cutovoi14-Aug-07 8:33 
GeneralRe: MDI app doesn't close Pin
Mark Salsbery14-Aug-07 8:43
Mark Salsbery14-Aug-07 8:43 
GeneralRe: MDI app doesn't close Pin
Alex Cutovoi14-Aug-07 9:56
Alex Cutovoi14-Aug-07 9:56 
GeneralRe: MDI app doesn't close Pin
Mark Salsbery14-Aug-07 10:05
Mark Salsbery14-Aug-07 10:05 
GeneralRe: MDI app doesn't close Pin
Alex Cutovoi14-Aug-07 10:54
Alex Cutovoi14-Aug-07 10:54 
GeneralRe: MDI app doesn't close Pin
Mark Salsbery14-Aug-07 11:12
Mark Salsbery14-Aug-07 11:12 
GeneralRe: MDI app doesn't close Pin
Alex Cutovoi15-Aug-07 3:36
Alex Cutovoi15-Aug-07 3:36 
GeneralRe: MDI app doesn't close Pin
Mark Salsbery15-Aug-07 5:12
Mark Salsbery15-Aug-07 5:12 
I posted a project (zipped) here[^]

The project is for VS 205 - if you're using a lower version and you want to run the code
in the debugger, , you can just extract the 3 header files, 2 cpp fles, 1 rc file, and 2 ico files
and put them in an empty project created with your VS.

It's a simple Win32 MDI app with the frame/MDI client and one child window class.
The project started as a Win32 wizard-generated project and I changed the appropriate
window stuff to MDI.
All the code's in one CPP file.  I added comments in the window procedures (callbacks).

Some of the key things are:

Make sure you return the proper value after handling messages - many are the same, some are different.

Make sure you call the default window procedure for certain messages that require it in MDI -
They are documented here[^]

Proper DestroyWindow()/PostQuitMessage sequence


Also shown is a proper message loop.  Once you get your windows working properly I should
be able to help you get your painting and redrawing up and running.  You definitely don't need to spin in
a loop, nor do you want to - you'll get really bad graphics and system performance Smile | :)  
I think you'll be much happier using all those CPU cycles for drawing instead of spinning in a loop doing nothing.

Feel free to email me as well as posting here - just click the email link at the bottom of my posts.

Cheers,
Mark



Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: MDI app doesn't close Pin
Alex Cutovoi15-Aug-07 6:47
Alex Cutovoi15-Aug-07 6:47 
Question_finite (CRT) [modified] Pin
Maxwell Chen14-Aug-07 5:15
Maxwell Chen14-Aug-07 5:15 
AnswerRe: _finite (CRT) Pin
Vasudevan Deepak Kumar14-Aug-07 5:18
Vasudevan Deepak Kumar14-Aug-07 5:18 
GeneralRe: _finite (CRT) Pin
Maxwell Chen14-Aug-07 5:22
Maxwell Chen14-Aug-07 5:22 
AnswerRe: _finite (CRT) Pin
Mark Salsbery14-Aug-07 6:12
Mark Salsbery14-Aug-07 6:12 
GeneralRe: _finite (CRT) Pin
Maxwell Chen14-Aug-07 6:14
Maxwell Chen14-Aug-07 6:14 
QuestionRe: _finite (CRT) Pin
Mark Salsbery14-Aug-07 6:20
Mark Salsbery14-Aug-07 6:20 
AnswerRe: _finite (CRT) Pin
led mike14-Aug-07 6:48
led mike14-Aug-07 6:48 
GeneralRe: _finite (CRT) Pin
Mark Salsbery14-Aug-07 6:52
Mark Salsbery14-Aug-07 6:52 
GeneralRe: _finite (CRT) Pin
Maxwell Chen14-Aug-07 6:53
Maxwell Chen14-Aug-07 6:53 
GeneralRe: _finite (CRT) Pin
Mark Salsbery14-Aug-07 7:03
Mark Salsbery14-Aug-07 7:03 
GeneralRe: _finite (CRT) Pin
Maxwell Chen14-Aug-07 7:05
Maxwell Chen14-Aug-07 7:05 
GeneralRe: _finite (CRT) Pin
led mike14-Aug-07 8:09
led mike14-Aug-07 8:09 
GeneralRe: _finite (CRT) Pin
Maxwell Chen14-Aug-07 8:19
Maxwell Chen14-Aug-07 8:19 
GeneralRe: _finite (CRT) Pin
El Corazon14-Aug-07 7:17
El Corazon14-Aug-07 7:17 
GeneralRe: _finite (CRT) Pin
Maxwell Chen14-Aug-07 8:19
Maxwell Chen14-Aug-07 8:19 
GeneralRe: _finite (CRT) Pin
El Corazon14-Aug-07 9:22
El Corazon14-Aug-07 9:22 

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.