Re: Overrides-Messages concept in MFC
An Over-ride is within the same class
CMyGreatClass : public CBase
//This overrides DoSomething in Base
//Calls base class functionality if needed
Now, on to messages...
There is this concept called a "Window".
A window is something that can send and receive messages.
In order for a class to be a "Window", it must inherit from CWnd and be =
So, instead of having pointers to every class, I can just send or post a =
to a window class.
So, in some child control it does something like this.
GetParent()->PostMessage(DRAW_ITEM, 1, 2);
int a = SomeParam; /* = 1 */
int b = OtherParam; /* = 2 */
"Yay, we got a message to draw something"
/* The Child window is whatever control and the Parent window is the =
View window. */
This will really explain alot.
"sawer" <firstname.lastname@example.org> wrote in message =
I have a basic question about MFC.
There are methods in MFC which are in overrides section or Message =
What is the difference?
For example: For CView class
OnDraw is in overrides section. But OnDrawItem is in messages section.
Why is it so?
What is the concept/logic behind this?
I hope i could explain my question.