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. strange Cbutton problem [modified]

strange Cbutton problem [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
helpcsharpc++visual-studioquestion
3 Posts 3 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.
  • B Offline
    B Offline
    big_denny_200
    wrote on last edited by
    #1

    hi all :) I have MFC application and a public method

    void CProject::Something(CButtonDerivedClass bButton)
    {
    // No matter what is here
    }

    When in OnInitDialog I call this method, I get error :

    ...
    Something(m_bDerivedButton);
    // bDerivedButton is an object of some CButton derived class
    // and is public member variable of current class
    ...

    error : Error 1 error C2248: 'CObject::CObject' : cannot access private member declared in class 'CObject' c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxwin.h 1814 Please help if you can. thanks -- modified at 6:47 Wednesday 14th June, 2006

    C 1 Reply Last reply
    0
    • B big_denny_200

      hi all :) I have MFC application and a public method

      void CProject::Something(CButtonDerivedClass bButton)
      {
      // No matter what is here
      }

      When in OnInitDialog I call this method, I get error :

      ...
      Something(m_bDerivedButton);
      // bDerivedButton is an object of some CButton derived class
      // and is public member variable of current class
      ...

      error : Error 1 error C2248: 'CObject::CObject' : cannot access private member declared in class 'CObject' c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxwin.h 1814 Please help if you can. thanks -- modified at 6:47 Wednesday 14th June, 2006

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      At a guess, it looks like the compiler can't make a copy of your class. So, can you pass it as a pointer or reference ? Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

      S 1 Reply Last reply
      0
      • C Christian Graus

        At a guess, it looks like the compiler can't make a copy of your class. So, can you pass it as a pointer or reference ? Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

        S Offline
        S Offline
        see me
        wrote on last edited by
        #3

        :rolleyes:Am also think the same. Need to pass the pointer or reference to the function. Please tel ur result. yours faithfully ajeeshcv

        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