Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to get a pointer to CView class from CMainFrame class

How to get a pointer to CView class from CMainFrame class

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mr2003
    wrote on last edited by
    #1

    Hi, I would like to know how to get a pointer to my CView class from CMainFrame class? Ehsan Behboudi

    S R 2 Replies Last reply
    0
    • M mr2003

      Hi, I would like to know how to get a pointer to my CView class from CMainFrame class? Ehsan Behboudi

      S Offline
      S Offline
      Swinefeaster
      wrote on last edited by
      #2

      See CFrameWnd::GetActiveView(). Cheers, swine [b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.

      M 1 Reply Last reply
      0
      • M mr2003

        Hi, I would like to know how to get a pointer to my CView class from CMainFrame class? Ehsan Behboudi

        R Offline
        R Offline
        Rage
        wrote on last edited by
        #3

        CFrameWnd::GetActiveView() ? ~RaGE();

        B 1 Reply Last reply
        0
        • S Swinefeaster

          See CFrameWnd::GetActiveView(). Cheers, swine [b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.

          M Offline
          M Offline
          mr2003
          wrote on last edited by
          #4

          i used it and i got an wierd error, I had to include my CView header file, in my case it is: #include "CMotionControllerView.h" and i got 3 error all had to do with the GetDocument() in CView class !!!!! Ehsan Behboudi

          S M 2 Replies Last reply
          0
          • M mr2003

            i used it and i got an wierd error, I had to include my CView header file, in my case it is: #include "CMotionControllerView.h" and i got 3 error all had to do with the GetDocument() in CView class !!!!! Ehsan Behboudi

            M Offline
            M Offline
            Michael P Butler
            wrote on last edited by
            #5

            You'll probably need to forward declare your CDocument derived class in the CMotionControllerView.h file. Michael 'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879

            1 Reply Last reply
            0
            • M mr2003

              i used it and i got an wierd error, I had to include my CView header file, in my case it is: #include "CMotionControllerView.h" and i got 3 error all had to do with the GetDocument() in CView class !!!!! Ehsan Behboudi

              S Offline
              S Offline
              Swinefeaster
              wrote on last edited by
              #6

              ok well that doesn't tell me much... you need to be more descriptive if you want help. :) what exact errors, etc? perhaps you didn't do the casting correctly...? [b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.

              1 Reply Last reply
              0
              • R Rage

                CFrameWnd::GetActiveView() ? ~RaGE();

                B Offline
                B Offline
                Bob Stanneveld
                wrote on last edited by
                #7

                It's all in msdn ;)

                A student knows little about a lot. A professor knows a lot about little. I know everything about nothing.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups