I can't seem to programmatically query whether a check box is checked or not.
Using Visual Studio's GUI Builder I dragged a "Check Box" from the Toolbox to my dialog. In Properties Editor I gave it an ID of IDC_MY_CHECK. It's just one check box, not a list of check boxes.
In my controller, in the callback for pushing a submit button I have the code
CCheckListBox* myChk = (CCheckListBox*)GetDlgItem(IDC_MY_CHECK);
int state = myChk->GetCheck(0)
I run it and check the box and click the submit button, but state is 0.
Did I wire it up incorrectly, or is a "Check Box" in the GUI editor not a CCheckListBox the way I think it is?
Aucun commentaire:
Enregistrer un commentaire