Click to See Complete Forum and Search --> : Confused !!!!


April 10th, 1999, 04:55 PM
VC++ document says CEditView contains CEdit, and yet when I replaced CEdit by CEditView in a child window, it doesn't work (ASSERT in CEditView.cpp). Any idea how to make CEditView works without creating a document class?. Thanks.

Dave Lorde
April 12th, 1999, 06:09 AM
You need to provide more information, like what exactly did you do, and where and what exactly was the error you got.

Dave

Masaaki
April 12th, 1999, 11:18 AM
Hi.

I guess that you're talking about this.
CEdit& GetEditCtrl( ) const;

To be sure, if we use GetEditCtrl().func of CEdit, CEditView object
can accesss public func of CEdit.
However, this doesn't mean that CEditView includes CEdit.
We just use CEdit func by the attachment of CTextView object.
So, if you try to create CEditView object on Dialog, you will get
assertion error because CEditView is not a control and derived from
CView class.
Someone posted the code to show CFormView on Dialog and if you are interested in this, check Dialog section of this site.

Hope for help.
-Masaaki Onishi-

Yangghi Min
April 12th, 1999, 07:40 PM
First of all, a view class derived from CView is desinged for being used in Doc-View architecture.
On this reason, it is not recommended to use a view without its document counterpart.
(As a matter of fact, all view classes are not simple wrappers of those useful controls,
they are tightly coupled with message pump of the application.)

If you are to make use of some facility provided with CEdit control, it will be better for you
to create a generic window and have it own your CEdit control as its child.

In addition to my recommendataion above, it will be helpful for you to try to use the Doc-View architecture of MFC.

Regards,
Yangghi.