CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 1999
    Location
    CA,USA
    Posts
    22

    Can I getTree-view and RichEdit in splitter windows?

    I am trying to get a TreeView and a RichEdit into a static splitter window, using doc/view in MFC.
    The tree view works fine, but when I try to get the Document, where the class pointer is stored, from the RichEdit class, he seems to be looking for a doc class based on Richedit.
    How can I pass the class pointer through the Document, do I need to multiply inherit the Doc from both the tree amd richedit?
    Is there another way?


  2. #2
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917

    Re: Can I getTree-view and RichEdit in splitter windows?

    You do not inherit document class from a view class. You can use framework to bind the same document to both views, since you want a document to govern data for both views (I guess), or you can do it yourself.

    From what I can guess it looks like you originally created your project using CTreeView derived class and after added splitter.
    Depending on the way you have created splitter and panes you can use different ways of doing it. If you could post a piece of code that you create splitter and panes it would help to find out what to do.


    I don't do it for ratings, but appreciation is always in style.
    Good luck in your journey in a C++ land.
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

  3. #3
    Join Date
    Oct 1999
    Location
    CA,USA
    Posts
    22

    Re: Can I getTree-view and RichEdit in splitter windows?

    Yes - you got it - that's the way I did it.
    As far as the splitter goes, I just added a CSplitterWnd m_wndSplitter; in mainFrm.h
    then did all of the paneSize() and CreateStatic()stuff in the MainFrm::OnCreateClient(), followed by a couple of CreateView() calls to fire up each side of the splitter window.

    So now, I call getDocument() from the tree view and store the treeview class pointer in the doc class.
    But when I try the same from the RichEdit code, the compiler objects that he cannot find a RichTextDoc class for the getDocument() call.

    Thanks,

    Bryan.



  4. #4
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917

    Re: Can I getTree-view and RichEdit in splitter windows?

    Now we are getting somewhere. I still do not have enough info. Do you have two document classes you want to govern each view or just one that will govern both views?

    At least post a list of classes you are using, or better yet, post a piece of code from OnCreateClient.



    I don't do it for ratings, but appreciation is always in style.
    Good luck in your journey in a C++ land.
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

  5. #5
    Join Date
    Sep 2000
    Location
    Germany
    Posts
    4

    Re: Can I getTree-view and RichEdit in splitter windows?

    Hi

    I have the same problems which you had befor one year.
    Ich have to combine a Edit View with a TreeView.
    But it do not work. I get an Access Violation, befor the Rich Edit View came up.
    Can you help me.
    For example can you send me your code to: GerdSzelig@web.de

    thanks.
    Gerd from Germany




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