CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Confused !!!!

  1. #1
    Guest

    Confused !!!!

    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.


  2. #2
    Join Date
    Apr 1999
    Posts
    383

    Re: Confused !!!!

    You need to provide more information, like what exactly did you do, and where and what exactly was the error you got.

    Dave


  3. #3
    Join Date
    May 1999
    Location
    Atlanta, GA, USA
    Posts
    443

    Re: Confused !!!!

    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-



  4. #4
    Join Date
    Apr 1999
    Posts
    4

    Re: Confused !!!!


    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.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured