Click here to Skip to main content
15,904,503 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I have a edit control which has id is IDC_SearchTxtBox and corressponding string is m_strUN
When I click a button it reads edit control value sometime not read(why?)
C++
if(m_strUN!="")
{
//todo
}
else
{
	MessageBox("Search text box is empty!", "SearchMessageBox",MB_ICONASTERISK | MB_OK);
}

and void abc::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	
	DDX_Text(pDX,IDC_SearchTxtBox,m_strUN);
}
Posted
Updated 22-Jul-12 20:26pm
v2

1 solution

Use to UpdateData[^] function in your button click handler to retrieve the content of the edit box into the m_strUN.
 
Share this answer
 
Comments
Maximilien 23-Jul-12 7:30am    
or use GetWindowText on your edit box

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900