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 I Can use 1 document which can be accessed by multiple views in SDI app.

How I Can use 1 document which can be accessed by multiple views in SDI app.

Scheduled Pinned Locked Moved C / C++ / MFC
c++
2 Posts 2 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.
  • C Offline
    C Offline
    crazymubashir
    wrote on last edited by
    #1

    Hi There, I want to know how I can support multiple ‘FormViews’ by having a single ‘Document’ class in my ‘SDI’ Application. The class which ‘MFC Wizard’ makes it for us supports the document. But the additional ‘FormViews’ which I put in doesn’t have access to the ‘Documents’ variables. The code which I tried my self are as follows: These are the additional or the ‘Nth’ classes Class CSection : public CFormView { … }; void CSection:: OnInitUpdate(void) { CMyDoc* pDoc = (CMyDoc*) GetDocument(); This code works in an SDI application in which classes are derived from ‘CRecordView’. } void CCourse:: OnInitUpdate(void) { CMyDoc* pDoc = reinterpret_cast (GetDocument()); }

    M 1 Reply Last reply
    0
    • C crazymubashir

      Hi There, I want to know how I can support multiple ‘FormViews’ by having a single ‘Document’ class in my ‘SDI’ Application. The class which ‘MFC Wizard’ makes it for us supports the document. But the additional ‘FormViews’ which I put in doesn’t have access to the ‘Documents’ variables. The code which I tried my self are as follows: These are the additional or the ‘Nth’ classes Class CSection : public CFormView { … }; void CSection:: OnInitUpdate(void) { CMyDoc* pDoc = (CMyDoc*) GetDocument(); This code works in an SDI application in which classes are derived from ‘CRecordView’. } void CCourse:: OnInitUpdate(void) { CMyDoc* pDoc = reinterpret_cast (GetDocument()); }

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

      http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q141/3/33.asp&NoWebContent=1[^] Michael But you know when the truth is told, That you can get what you want or you can just get old, Your're going to kick off before you even get halfway through. When will you realise... Vienna waits for you? - "The Stranger," Billy Joel

      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