MFC help for a beginner
-
I am currently trying to add variable names to radio buttons and combo boxes. Once I add a variable name to the radio buttons, my program no longer runs properly, if at all. Please help!!
-
I am currently trying to add variable names to radio buttons and combo boxes. Once I add a variable name to the radio buttons, my program no longer runs properly, if at all. Please help!!
Changing names on buttons is a simple matter (SetWindowText). So there must be more to this problem. Are you running the debug version with a memory validator turned on (that would help a little). There is also the possibility that the cause occured because of an error in your code that happen before you changed the name, but that usualy results in a runtime error. Insuffient information! INTP "The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes." Andrew W. Troelsen
-
I am currently trying to add variable names to radio buttons and combo boxes. Once I add a variable name to the radio buttons, my program no longer runs properly, if at all. Please help!!
-
I am not getting an error message. That is the weird thing. My dialog window just doesn't pop up when I hit run. My program runs fine until I right click on the button and go to add variable. These are the lines that are making it mess up, because if i comment them out, it runs fine again: This is declared in my .h file: CButton m_remOff; This is generated in the dodataexchange function: DDX_Control(pDX, IDC_RADIO_REMOFF, m_remOff); Also if I make a line like m_remOff.setCheck(true) that causes problems. Is there another line of code that should be generated automatically somewhere else? I am using .net 2003.
-
I am not getting an error message. That is the weird thing. My dialog window just doesn't pop up when I hit run. My program runs fine until I right click on the button and go to add variable. These are the lines that are making it mess up, because if i comment them out, it runs fine again: This is declared in my .h file: CButton m_remOff; This is generated in the dodataexchange function: DDX_Control(pDX, IDC_RADIO_REMOFF, m_remOff); Also if I make a line like m_remOff.setCheck(true) that causes problems. Is there another line of code that should be generated automatically somewhere else? I am using .net 2003.
I'm not an advanced programmer, but I thought having SOME reply is better than nothing... I get your behavior sometimes and often it's because the number/label of your ID (ID_RADIO_REMOFF) is not in sync with other parts of the code (dialog designer), so ensure that all these references match. Also, I believe that the DDX stuff is for moving data between a control and a simple data variable (e.g., int, CString, etc.), so it seems odd to me that there needs to be an exchange of data between your dialog control and your local variable that points to that control. thanks, JennyP