Re: Inheritance and MFC - Completed
I finally figured it out. =
I am creating a control, which contains a control.
I wasn't sure how to go about creating a control and was just doing =
SomeClass::OnMouseMove(int x, int y)
That worked just fine, Until I wanted to add a scrollbar to my control.
I considered it a control, but in reality it wasn't a control, but just =
I couldn't quite figure out how to make the object independent and turn =
it into a control.
What I needed to do was register a window class in order to receive =
messages be able
to create the scrollbar control.
That, plus I would not need the OnDraw() or OnMouseMove() outside the =
This is what I am doing. (It's basically in the link, except for the =
CGridSB : public CGrid, CWnd
bar.Create(this....) //works now because this class is registered to =
warning C4407: cast between different pointer to member representations, =
compiler may generate incorrect code
CGridSB : public CWnd, CGrid //Fixes the warning and error
I had to remove the CGrid: public CObject like David said.