Re: Inheritance and MFC
You didn't post any of the code from your grid object, but if it is a
control or displays anything I'll be it is already derived from or contains
a CWnd at some point. Is this an object you created or one you can point us
to on the web so we could get a better look at what it's doing?
Tom
"Nobody" <Nobody@yahoo.com> wrote in message
news:ONG3vdVvHHA.3772@TK2MSFTNGP05.phx.gbl...
Hi,
I have a grid object. The Grid Object inherits from CObject.
There are no controls and I was thinking about adding some. Zoom, Pan, etc.
So, I have extantiated a new class that inherits from CGrid and CWnd.
class CGridSB : public CGrid, public CWnd
Now, I would like to add some controls to the Grid Object.
The problem is that the controls needs an m_hWnd
I am not sure what to do?
VERIFY(c_sbHZoom.Create(
SBS_VERT | SBS_RIGHTALIGN | WS_CHILD |WS_BORDER,
Rect,
this,
1234)
);
_AFXWIN_INLINE void CScrollBar::ShowScrollBar(BOOL bShow)
{ ASSERT(::IsWindow(m_hWnd)); ::ShowScrollBar(m_hWnd, SB_CTL, bShow); }
I understand that the CGridSB oject needs to handle the Scrollbar messages,
so I need a message map
and perphaps a DECLARE_DYNCREATE along with an IMPLEMENT_DYNCREATE member.
I just need to get past the m_hWnd error.
Thanks for your help,