Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ComboBox Problem - takes 2 tries to get DDX to work

Status
Not open for further replies.

HighAnxiety

Programmer
Feb 9, 2005
2
US
I'm running a C++ app generated from MS-Dev 6.0. Seeing a problem when I make a combobox selection. It takes two clicks on any combobox selection for the DDX update to grab the data from the form. No matter which one I select, the DDX exchange always provides the previous selection. If I click on the same selection twice, my string is finally updated.
Here is line:
DDX_CBString(pDX, IDC_INTERP_RATIO, m_csInterpRatio)
 
Are you calling UpdateData() when you get a click message? Post code.
 
Yes, calling UpdateData(TRUE) below to retrieve the form data;

void XYZ::OnSelchangeInterpRatio()
{
// AfxMessageBox(L"Interpolation rate change detected");

UpdateData(TRUE); //Capture the new value from the form

// < String processing done here >

}

void XYZ::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);

//{{AFX_DATA_MAP(XYZ)
DDX_Control(pDX, IDC_BUTTON_DN, m_downArrow);
DDX_Control(pDX, IDC_BUTTON_UP, m_upArrow);
DDX_Control(pDX, IDC_BUTTON_RT, m_rightArrow);
DDX_Control(pDX, IDC_BUTTON_LT, m_leftArrow);
DDX_CBString(pDX, IDC_VERT_SPEED, m_csSweepTime);
DDX_CBString(pDX, IDC_INTERP_RATIO, m_csInterpRatio);
//}}AFX_DATA_MAP
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top