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

Thread: MFC CRichEditView vs CRichEditCtrl

  1. #1
    Join Date
    Apr 2013
    Posts
    3

    MFC CRichEditView vs CRichEditCtrl

    I was looking at the source code of CRichEditView::GetRichEditCtrl and it looks like they are type casting the view into a ctrl (even though there is no inheritence or subobject of the appropriate type). I've been looking into this but I thought I'd as how these two classes even line up? They don't appear to have much in common, but at the top of the CRichEditCtrl class it mentions:

    This class must remain a binary-compatible subset of CRichEditView. Do not add data members or virtual functions directly to this class.
    Can someone explain how to "view" these corresponding classes, in spite of their differences. Examples (especially related to CRichEditCtrl/View appreciated), as I'm not really understanding the linkage.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,271

    Re: MFC CRichEditView vs CRichEditCtrl

    Victor Nijegorodov

  3. #3
    Join Date
    Apr 2013
    Posts
    3

    Re: MFC CRichEditView vs CRichEditCtrl

    Wow that article was dead on, thank you VictorN.

  4. #4
    Join Date
    Apr 2013
    Posts
    3

    Re: MFC CRichEditView vs CRichEditCtrl

    SHouldn't this trick still be possible if you derived a custom class directly from CView, instead of deriving from CCtrlView? Since They are both derived from CWnd (eventually) and you're only interested in using h_Wnd.

    What would be the benefit of deriving from CCtrlView?

  5. #5
    Arjay's Avatar
    Arjay is online now Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,196

    Re: MFC CRichEditView vs CRichEditCtrl

    Quote Originally Posted by remstadt View Post
    SHouldn't this trick still be possible if you derived a custom class directly from CView, instead of deriving from CCtrlView? Since They are both derived from CWnd (eventually) and you're only interested in using h_Wnd.

    What would be the benefit of deriving from CCtrlView?
    In the link that Victor gave, Paul describes the differences in the section where he talks about the CCtrlView. Essentially CCtrlView adds a property and a couple of methods to CView. You certainly could add this to a class derived directly from CView, but what would that get you (since it's already done for you)?

Tags for this Thread

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center