Click here to Skip to main content
15,914,891 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralNT Expert needed Pin
Georg Haan24-Jul-02 11:06
Georg Haan24-Jul-02 11:06 
GeneralRe: NT Expert needed Pin
Anders Molin24-Jul-02 11:29
professionalAnders Molin24-Jul-02 11:29 
GeneralRe: NT Expert needed Pin
Martin Ziacek24-Jul-02 11:33
Martin Ziacek24-Jul-02 11:33 
QuestionHow do I change OnDraw?? Pin
NickOne24-Jul-02 11:02
NickOne24-Jul-02 11:02 
AnswerRe: How do I change OnDraw?? Pin
Chris Losinger24-Jul-02 11:15
professionalChris Losinger24-Jul-02 11:15 
GeneralRe: How do I change OnDraw?? Pin
NickOne24-Jul-02 11:34
NickOne24-Jul-02 11:34 
GeneralRe: How do I change OnDraw?? Pin
Chris Losinger24-Jul-02 11:37
professionalChris Losinger24-Jul-02 11:37 
GeneralRe: How do I change OnDraw?? Pin
Paul M Watt24-Jul-02 19:39
mentorPaul M Watt24-Jul-02 19:39 
I would like to give you one more piece of information that you might find helpful as to why the OnDraw and OnPaint methods exist and when to use them.

OnPaint is a message handler that handles an actual message from windows (WM_PAINT). Every window will get a WM_PAINT message, and in turn the OnPaint handler will be called when a window needs to be repainted. This includes buttons, static controls, treeview controls, dialogs and so on, even the MDI children that you are handling the OnDraw method.

The OnDraw method is a method in MFC that is usually used for windows that represent documents. The default action for the OnPaint handler of a document window prepares a HDC and calls the OnDraw handler. All of your painting that is required for your document should go in the OnDraw handler. This is because MFC also has the OnPrint or WM_PRINT message call the same OnDraw handler that you used to draw your window. The only difference is that it passes you a HDC that is for a printer rather than your monitor. This allows you to perform the painting code for your document in one place, and the MFC framework can take advantage of that.


Build a man a fire, and he will be warm for a day
Light a man on fire, and he will be warm for the rest of his life!

QuestionHow do l execute a program from within the code? Pin
citress24-Jul-02 10:38
citress24-Jul-02 10:38 
AnswerRe: How do l execute a program from within the code? Pin
Ravi Bhavnani24-Jul-02 10:51
professionalRavi Bhavnani24-Jul-02 10:51 
AnswerRe: How do l execute a program from within the code? Pin
Georg Haan24-Jul-02 10:54
Georg Haan24-Jul-02 10:54 
AnswerRe: How do l execute a program from within the code? Pin
Todd Smith24-Jul-02 14:00
Todd Smith24-Jul-02 14:00 
Generalpuzzling question about pointers - *char Pin
ns24-Jul-02 10:37
ns24-Jul-02 10:37 
GeneralRe: puzzling question about pointers - *char Pin
David Chamberlain24-Jul-02 10:42
David Chamberlain24-Jul-02 10:42 
GeneralThank you.- another related question: Pin
ns24-Jul-02 10:58
ns24-Jul-02 10:58 
GeneralRe: Thank you.- another related question: Pin
David Chamberlain24-Jul-02 11:05
David Chamberlain24-Jul-02 11:05 
GeneralRe: Thank you.- another related question: Pin
ns25-Jul-02 1:19
ns25-Jul-02 1:19 
GeneralRe: puzzling question about pointers - *char Pin
Ravi Bhavnani24-Jul-02 10:49
professionalRavi Bhavnani24-Jul-02 10:49 
GeneralRe: puzzling question about pointers - *char Pin
ns25-Jul-02 1:18
ns25-Jul-02 1:18 
GeneralRe: puzzling question about pointers - *char Pin
Ravi Bhavnani25-Jul-02 2:36
professionalRavi Bhavnani25-Jul-02 2:36 
GeneralNever mind... Pin
Ravi Bhavnani25-Jul-02 2:37
professionalRavi Bhavnani25-Jul-02 2:37 
QuestionCan you create two CDialogBars in a frame window? Pin
JohnnyG24-Jul-02 10:28
JohnnyG24-Jul-02 10:28 
GeneralQuestion Mark Handling in ADO Pin
newlogsign24-Jul-02 9:52
newlogsign24-Jul-02 9:52 
QuestionHow do I prevent my application showing a button on the taskbar? Pin
adara24-Jul-02 8:09
adara24-Jul-02 8:09 
AnswerRe: How do I prevent my application showing a button on the taskbar? Pin
Ravi Bhavnani24-Jul-02 10:54
professionalRavi Bhavnani24-Jul-02 10:54 

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.