#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    29
    Rep Power
    0

    Confused With Views


    I'm a total newb when it comes to the Doc/View architecture . . . I mean, I understand the concept, I just can't implement anything beyond a simple SDI app with one view. Anyway, I have an example prog by someone else that I want to modify (as a "learning experience") to have a second view.

    Basically, it's an SDI application with the author's version of a Tree/List control as its only view. I'm trying to add a second view on the right that is a list box (or list view, I guess).

    Anyway, my first problem: I went into ClassWizard and clicked "New -> Class", then named it "CRightView" and said it should be derived from CListView. However, I get all sorts of errors when compiling:

    RightView.cpp
    error C2504: 'CListView' : base class undefined
    error C2440: 'return' : cannot convert from 'class CRightView *' to 'class CObject *'
    error C2653: 'CListView' : is not a class or namespace name
    error C2065: 'classCListView' : undeclared identifier
    error C2653: 'CListView' : is not a class or namespace name
    error C2065: 'GetDocument' : undeclared identifier
    error C2440: 'initializing' : cannot convert from 'int' to 'class CDocument *'
    error C2653: 'CListView' : is not a class or namespace name
    error C2653: 'CListView' : is not a class or namespace name
    I assume I added the class the wrong way . . . what's the right way?
  2. #2
  3. No Profile Picture
    Offensive Member
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2002
    Location
    in the perfect world
    Posts
    622
    Rep Power
    27
    Not 100% what you want so two choices;

    Want a second 'pane' on right.

    SDI = single document interface. May not take second view under MFC. Or at least require a splitter window.

    >>then named it "CRightView" and said it should be derived from CListView.

    No you want the CView class.



    Or if you just want a listview on the right of the treeview.
    Then try the CListCtrl class and ensure your headers are in the correct order. Thats your current error.
    The essence of Christianity is told us in the Garden of Eden history. The fruit that was forbidden was on the Tree of Knowledge. The subtext is, All the suffering you have is because you wanted to find out what was going on. You could be in the Garden of Eden if you had just kept your f***ing mouth shut and hadn't asked any questions.

    Frank Zappa
  4. #3
  5. No Profile Picture
    Offensive Member
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2002
    Location
    in the perfect world
    Posts
    622
    Rep Power
    27
    edit:: posted twice.
    The essence of Christianity is told us in the Garden of Eden history. The fruit that was forbidden was on the Tree of Knowledge. The subtext is, All the suffering you have is because you wanted to find out what was going on. You could be in the Garden of Eden if you had just kept your f***ing mouth shut and hadn't asked any questions.

    Frank Zappa

IMN logo majestic logo threadwatch logo seochat tools logo