Re: AppWizard & CChildView
"Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp> wrote in message
news:ejbA1adAIHA.4160@TK2MSFTNGP06.phx.gbl...
"William" <port@mx15.freecom.ne.jp> wrote in message
news:uUlCFobAIHA.3940@TK2MSFTNGP05.phx.gbl...
Env: WindowsXP, VC++6.00
I am trying to use AppWizard to create a Non-Document/View MDI App. But
why can not I specify CChildView : public CScrollView instead of
CChildView : public CWnd?
All CView-derived classes call CDocument. So they don't work if you don't
have a CDocument. You should use the doc/view framework if you want
CView's. You can just leave the CDocument empty if you like.
The AppWizard has a checkbox that says somethinig like, "Use Document/View"
if you don't specify a dialog app. If this is not set, you still get a
CChildView, but it derives from CWnd, and not CView. This makes sense,
because a CView knows about the CDocument, and there isn't one. That's why
your CChildView is derived from CWnd instead.
If you want it to derive from CView, you need to set the "Use Document/View"
checkbox and, as Scott says, leave the CDocument derived class unntouched.
-- David