|
|
|
|
Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
Roberto Manes
|
Apr 1, 2005 - 6:03 AM
|
I’m facing some problems using two CExtRadioButtons in a CExtResizableDialog. I declared two CExtRadioButton variables, the first one has the Group option set to TRUE. I also declared one variable of type int to be used with the UpdataData() function to set the radio buttons. In the DoDataExchange() function I wrote the following code DDX_Control(pDX, IDC_RADIO1, m_wndRadio1); DDX_Control(pDX, IDC_RADIO2, m_wndRadio2); DDX_Radio(pDX, IDC_RADIO1, m_radioVariable);
When I catch the ON_BN_CLICKED message, the call of the UpdateData(true) function doesn’t update the variable m_radioVariable and if I want to update the aspect of the radio button I have to call the SetCheck() method. Do you have any idea ?
Thanks in advance for your help
|
|
Technical Support
|
Apr 1, 2005 - 7:51 AM
|
Just use the DDX_Radio function first (before using any of the DDX_Control functions) like below:DDX_Radio(pDX, IDC_RADIO1, m_radioVariable);
DDX_Control(pDX, IDC_RADIO1, m_wndRadio1);
DDX_Control(pDX, IDC_RADIO2, m_wndRadio2); Please note that in case of using both the DDX_Radio and DDX_Control methods, you need to invoke UpdateData( FALSE ) at the end of the OnInitDialog method.
|
|
Roberto Manes
|
Apr 1, 2005 - 8:42 AM
|
I’ve tried to put the DDX_Radio function first but it still not working. Soon after I catch the ON_BN_CLICKED message and after having called the UpdateData(true) function my variable is not updated. Besides if I click the second radio button I get two radio buttons switched on and I cannot turn them off.
|
|
Roberto Manes
|
Apr 1, 2005 - 10:52 AM
|
I hope this can help you. I found out that it’s not working probably because my CExtRadioButtons belongs to a CExtResizableDialog which is child of a CExtTabPageContainerWnd. I’ve tried with another popup CExtResizableDialog and it works. It also works with a CExtResizableDialog which is child of a CExtResizablePropertyPage.
|
|
Technical Support
|
Apr 3, 2005 - 11:01 AM
|
We tested this case once more and must say that int m_radioVariable is successfully updated when CExtRadioButton variables are children of CExtResizableDialog , which, in turn, is a child of CExtTabPageContainerWnd . We also tested some other cases of windows relationship and found no problems. So, if it’s possible, send us a sample project so that we can quickly help you.
|
|
Roberto Manes
|
Apr 5, 2005 - 10:02 AM
|
In order to solve the problem I removed the two radio buttons and I added them again. Note that I’ve called the radio buttons with the same names and I’ve assigned the same ID numbers. ??!!! Thanks anyway for your support
|
|