Painter for CMyDocView does not inherit from CView - How to?
- From: "Luke \(may the source be with you\)" <luke.evans@xxxxxxxxxxxx>
- Date: Wed, 8 Mar 2006 21:48:36 +1100
Yellow.
I recently grabbed a free CDataGrid class, nice and lightweight and I want
to use this in my SDI view. I understand that my views (if I have more than
one) need to inherit from CView, or from a control which has CView as a base
class.
CDataGrid does not inherit from any MFC controls - it is entirely custom
written.
So I used the AppWizard CMyView and made a member pointer to my CDataGrid
class which instantiates along with the CMyView - no probs.
The WM_PAINT messages are being processed by the CDataGrid object (which in
its Create() call CreateWindowEx(...)), but I see nothing happening in the
client window!
Do I need to make the client view transparent? How?
I know the CDataGrid works, because once I Create()d it in the h_Wnd of the
menu and toolbars and I could see portions of it being drawn.
Why won't it appear in my SDI client window?
I am doing this:
void CTestGridView::OnInitialUpdate()
{
m_pDG = new CDataGrid();
RECT rect = {50,50,700,300}; // Create DataGrid child window
m_pDG->Create(rect, AfxGetMainWnd()->m_hWnd, 5);
//setup grid etc
CView::OnInitialUpdate();
}
Many thanks
Luke
(may the source be with you)
.
- Follow-Ups:
- Re: Painter for CMyDocView does not inherit from CView - How to?
- From: Joseph M . Newcomer
- Re: Painter for CMyDocView does not inherit from CView - How to?
- From: David Wilkinson
- Re: Painter for CMyDocView does not inherit from CView - How to?
- Prev by Date: Re: Problems linking CxImage
- Next by Date: closing ASyncSocket
- Previous by thread: VS2005 typedef void * POINTER_64 PVOID64;
- Next by thread: Re: Painter for CMyDocView does not inherit from CView - How to?
- Index(es):
Relevant Pages
|