CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2011
    Posts
    60

    pointing to CButtons in the constructor

    I have 22 CButtons and I'm trying to set each one to the corresponding position in a CButton array of size 22 in the constructor.

    Code:
    *buttons[0] = m_button1;
    This code gives me an error in the compiler. Any help would be appreciated. Thank you for taking time from your busy day to help me out.

    error C2248: 'CObject:perator =' : cannot access private member declared in class 'CObject'

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: pointing to CButtons in the constructor

    Quote Originally Posted by Gregorina View Post
    I have 22 CButtons and I'm trying to set each one to the corresponding position in a CButton array of size 22 in the constructor.

    Code:
    *buttons[0] = m_button1;
    This code gives me an error in the compiler. Any help would be appreciated. Thank you for taking time from your busy day to help me out.

    error C2248: 'CObject:perator =' : cannot access private member declared in class 'CObject'
    How are buttons and m_button1 defined? I would think you have it kind of backwards. Assuming

    CButton m_button1;
    CButton* buttons[22];

    You'd want
    buttons[0] = &m_button1;

  3. #3
    Join Date
    Mar 2011
    Posts
    60

    Re: pointing to CButtons in the constructor

    Thank you very much.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured