-
February 4th, 2014, 07:30 PM
#1
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'
-
February 4th, 2014, 07:55 PM
#2
Re: pointing to CButtons in the constructor
Originally Posted by Gregorina
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;
-
February 4th, 2014, 08:08 PM
#3
Re: pointing to CButtons in the constructor
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|