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. 'CDocument::UpdateAllViews' : illegal call of non-static member function problem

'CDocument::UpdateAllViews' : illegal call of non-static member function problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionannouncement
3 Posts 2 Posters 1 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.
  • B Offline
    B Offline
    boon kian
    wrote on last edited by
    #1

    Hi I have a prob here as follow: I have a SDI program based on CView. From the program, a dialog box was called. However from the dialog box i need to call the UpdateAllView function (which is found as a based function of CView) to update all Views of my main program. Is it possible to do so ?? When i tried doing it i got a complier error "'CDocument::UpdateAllViews' : illegal call of non-static member function" How can i go abt calling a CView based class function from a dialog based class ?? Thank you !! bk

    T 1 Reply Last reply
    0
    • B boon kian

      Hi I have a prob here as follow: I have a SDI program based on CView. From the program, a dialog box was called. However from the dialog box i need to call the UpdateAllView function (which is found as a based function of CView) to update all Views of my main program. Is it possible to do so ?? When i tried doing it i got a complier error "'CDocument::UpdateAllViews' : illegal call of non-static member function" How can i go abt calling a CView based class function from a dialog based class ?? Thank you !! bk

      T Offline
      T Offline
      trustno1
      wrote on last edited by
      #2

      modify the constructor of your dialog class so that it accept a document object.. once you done that, you should be able to call updateallviews from a dialog.. something like this: Cmydialog dialog(...,pDoc); pDoc is the document object that you use to call updateallviews from the your dialog.

      B 1 Reply Last reply
      0
      • T trustno1

        modify the constructor of your dialog class so that it accept a document object.. once you done that, you should be able to call updateallviews from a dialog.. something like this: Cmydialog dialog(...,pDoc); pDoc is the document object that you use to call updateallviews from the your dialog.

        B Offline
        B Offline
        boon kian
        wrote on last edited by
        #3

        Hi trustnol, firstly thanx a lot for your help ... I am quite new in C++ so i am very bad in those object kind of things... therefore i still have some doubts which i like to clarify with u .... 1. constructor is like this ?? CmyDialog dialog (CDocument *pDoc) 2. becos wat calling my dialog is the doc class of my main program ... so do i do pass the "this" pointer over to the dialog constructor ?? CABCdoc::onopen() { Cmydialog efg(this); } is this correct ??? thank you very much for your kind attention !!

        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