CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 1999
    Location
    Poland
    Posts
    278

    Include MyView.h file to another class ?.

    I have SDI app. created by APP Vizard. Could you explain me, why I can not add for example in CMyDlg.cpp file this line:
    Code:
    #include "MyView.h"
    When I add this line to my CMyDlg.cpp file I receive errors as follows:

    c:\and\cpp\myprojects\baxh\baxhview.h(28) : error C2143: syntax error : missing ';' before '*'
    c:\and\cpp\myprojects\baxh\baxhview.h(28) : error C2501: 'CBaxhDoc' : missing storage-class or type specifiers
    c:\and\cpp\myprojects\baxh\baxhview.h(28) : error C2501: 'GetDocument' : missing storage-class or type specifiers

    Would you explain me, How to add MyView.h file to my another class. I need to have access to CMyView class.

    Thanks in advance.

  2. #2
    Join Date
    May 2002
    Location
    Romania
    Posts
    929
    I need to have access to CMyView class.
    Put

    class CMyView;

    in your .h file.

    Snakekaa
    Move like a snake, think like a snake, be a snake !!!

  3. #3
    Join Date
    Sep 2002
    Location
    14° 39'19.65"N / 121° 1'44.34"E
    Posts
    9,815

    Re: Include MyView.h file to another class ?.

    Originally posted by Andrzej
    Would you explain me, How to add MyView.h file to my another class. I need to have access to CMyView class.
    A view never goes without a doc (the interface of CMyView contains references to the corresponding document class). Therefore, you have to add the #include for your document just before #including your view.

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