Hello, I am somewhat new to windows programming and was wondering if someone could answer a question I have about some strange behavior. I have a row of check boxes that I am using to check individually, and also one check box called all that will check or uncheck all of the other boxes, according to if it is checked or unchecked itself. Here's what I am doing for normal check boxes.
What this does (or is supposed to do) is if the check is already set, unset it and set the member variable to false, otherwise it must be unchecked so we check it and set to true.
That code is in the single checkboxes, like check1, check2, check3, etc. However, it does not seem to work. When the box is unchecked, it goes to if and if it's checked it goes to the else. Now comes the strange part. In the check all check box I have code that looks like this.
CButton *btnPtr = (CButton *) GetDlgItem(IDC_CHECK_1);
m_check1 = false;
m_check1 = true;
When that code executes all the check boxes actually check and behave how I want them to. However when trying to check them individually they seem to function in the opposite manner. Does anyone know what could be the problem? Thank you.
m_check1_all = true;