Thread: Including MyProjectView.h

  1. #1
    Registered User
    Join Date
    Sep 2001
    Location
    England
    Posts
    121

    Including MyProjectView.h

    I'm trying to get a pointer to my CMyProjectView in CMyPropertyPage, but when I try to include MyProjectView.h to do this, I get errors relating to the line:

    CMyProjectDoc* GetDocument() const;

    Despite MyProjectView compiling fine when not included in CMyPropertyPage. The errors are:

    MyPropertyPage.cpp
    MyProjectView.h(24) : error C2143: syntax error : missing ';' before '*'
    MyProjectView.h(24) : error C2501: 'CRollersView::CRollersDoc' : missing storage-class or type specifiers
    MyProjectView.h(24) : error C2501: 'CRollersView::GetDocument' : missing storage-class or type specifiers
    MyProjectView.h(24) : warning C4183: 'GetDocument': missing return type; assumed to be a member function returning 'int'

    Is there a way of getting a pointer to a class without including it's header, or is there a way of getting around these errors?

    Thanks

  2. #2
    Registered User sean345's Avatar
    Join Date
    Mar 2002
    Posts
    346
    It seems that the error is actually with the code. There is a ';' missing after a line. Check the line the error is at and the ones before it to see if one is missing. I think the other errors are caused by this one mistake.

    - Sean
    If cities were built like software is built, the first woodpecker to come along would level civilization.
    Black Frog Studios

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Including extra .cpp files visual2008
    By Cathalo in forum C++ Programming
    Replies: 9
    Last Post: 06-16-2009, 03:29 AM
  2. Can we have vector of vector?
    By ketu1 in forum C++ Programming
    Replies: 24
    Last Post: 01-03-2008, 05:02 AM
  3. Class files including other classes
    By combatdave in forum C++ Programming
    Replies: 7
    Last Post: 11-04-2006, 12:37 AM
  4. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  5. Reading a line including blanks
    By Ec4U2du in forum C++ Programming
    Replies: 4
    Last Post: 11-13-2002, 07:32 PM