Hi,
I haven't coded Visual C++ dialogs in aeons and am working off vague memories and can't find my solution in the reference books I've hunted through. Plus while I've trawled through MSDN I can't seem to find it there either. I am trying to understand the code below and why one of the controls does not update.
Basically, I thought that the following code associated the member variable m_sRefGrid with the variable sRefGridNumber.
Plus, since I can't see any other connection between these variables and the SetupPr variables, this is where I was assuming they were connected. The sxxx and syyy variables update correctly when a certain button is pushed and the UpdateData function is run, however the m_sRefGrid variable is correctly set but has no effect on sRefGridNumber.
I already tried explicitly assigning the sRefGridNumber to the m_sRefGrid value when the radio button is selected. It compiles but has no effect.
Basically, I am not sure where to assign sRefGridNumber to the m_sRefGrid value. The m_sRefGrid value changes reasonably often depending on operator input, so I need to update the sRefGridNumber variable everytime it changes and keep it current.
Help! Even good code examples online / MSDN or reference texts would be welcome. I need a good book for Visual C++ programming that doesn't only give Wizard examples.
Jha
I haven't coded Visual C++ dialogs in aeons and am working off vague memories and can't find my solution in the reference books I've hunted through. Plus while I've trawled through MSDN I can't seem to find it there either. I am trying to understand the code below and why one of the controls does not update.
Basically, I thought that the following code associated the member variable m_sRefGrid with the variable sRefGridNumber.
Code:
CXXXDlg::CXXXDlg(CSetupDlg * pParent)
:CDialogNL(CXXXDlg::IDD,pParent),
m_pParent(pParent),
m_sxxx(pParent->GetTeachDataPtr()->GetSetupPtr()->sxxx),
m_sRefGrid(pParent->GetTeachDataPtr()->GetSetupPtr()->sRefGridNumber),
m_syyy(pParent->GetTeachDataPtr()->GetSetupPtr()->syyy),
m_bEnabled(true),
{
Create(CXXXDlg::IDD,pParent);
EnableAllControls(false);
ShowWindow(SW_HIDE);
}
Plus, since I can't see any other connection between these variables and the SetupPr variables, this is where I was assuming they were connected. The sxxx and syyy variables update correctly when a certain button is pushed and the UpdateData function is run, however the m_sRefGrid variable is correctly set but has no effect on sRefGridNumber.
I already tried explicitly assigning the sRefGridNumber to the m_sRefGrid value when the radio button is selected. It compiles but has no effect.
Code:
// A Reference Grid radio button has been selected.
void CXXXDlg::OnRefGridSelected(UINT uiCmd)
{
m_sRefGrid = (short) (uiCmd - IDC_WS_REFGRID_1);
m_pParent->GetTeachDataPtr()->GetSetupPtr()->sRefGridNumber = m_sRefGrid; // My new code
UpdateGridData();
}
Help! Even good code examples online / MSDN or reference texts would be welcome. I need a good book for Visual C++ programming that doesn't only give Wizard examples.
Jha