Hi all!
while learing to code a CEdit box i encouterd something that i don't understand.
The below code 1st pre-clears a string using ZeroMemory function.
The TRACE statement always gives CEDITN: 0 in the debug
window.
When commenting out ZeroMemory then CEDITN returns
suddenly the ammout of characters typed in.
Code:
/////////////////////////////////////////////////////////////////////////////
// CDlgNewString
void CDlgNewString::OnChangeEditNewString()
{
ZeroMemory(&m_cNewString[0], 14);
CEdit *pEdit = (CEdit *)GetDlgItem(IDC_EDIT_NEWSTRING);
int n = pEdit->GetLine (0, &m_cNewString[0]);
TRACE("CEDITN: %ld\n", n);
if (!n)
GetDlgItem(IDOK)->EnableWindow(false);
else
GetDlgItem(IDOK)->EnableWindow(true);
}
Can somebody please tell, why ZeroMemory influences a CEdit Control ??
Regards,
Robert