How to get pointer to CMyView class from CMainFrame class?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Thread: How to get pointer to CMyView class from CMainFrame class?

Threaded View

  1. #1
    Join Date
    Nov 2013
    Posts
    5

    How to get pointer to CMyView class from CMainFrame class?

    My program is a basic MFC AppWizard (exe) created project in VC++ 6.
    In MainFrm.cpp, I am trying to access some user defined CMyView member functions.
    However when I try to do the standard procedure to get the CMyView pointer in MainFrm.cpp, I get the " ... 'CMyView' : undeclared identifier" error. To resolve this, I add " #include myView.h " at the top of MainFrm.h which then produces the following errors:

    Code:
    myview.h(21) : error C2143: syntax error : missing ';' before '*'
    myview.h(21) : error C2501: 'CMyDoc' : missing storage-class or type specifiers
    myview.h(21) : error C2501: 'GetDocument' : missing storage-class or type specifiers
    What do these errors mean? Is there a simple way to access CMyView member functions from CMainFrame? Please help!
    Last edited by coderDude1; November 29th, 2013 at 01:24 PM.

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