Hi all,
I am just trying a simple program that need to get some data from edit box.
I created a MFC edit box using the wizard as a value of type integer.
int m_AllocCount; // this is member variable declared in my header
it is properly associated the member variable with control
CDialogEx::DoDataExchange(pDX);
DDX_Text(pDX, IDC_EDIT1, m_AllocCount);
And on a button click I just called the UpdateData to get the value from control to m_AllocCount.
CWnd *pEditBox = GetDlgItem( IDC_EDIT1 );
if( pEditBox )
{
if( pEditBox->UpdateData( TRUE ))
{
CString csTest;
csTest.Format( _T( "Value : %d" ), m_AllocCount );
AfxMessageBox( csTest );
}
}
I given a proper value in edit box and executed the code.
But it always displaying 0. It looks like the data is not transferring from control to member variable.
Please help me to correct the code
Platform:
Visual Studio 2010
It a MFC dialog based application,
64 bit Windows 7, but the program is 32 bit application.