In case it is of any help, I suggest you follow the following policy when implement OnUpdate: Have a boolean flag, say m_bInOnUpdate to prevent reentrancy, and do not call SetWindowText till you've parsed the whole string. Sort of like this:
BOOL CStringEdit::OnUpdate()
{
if(m_bInOnUpDate)return TRUE;
m_bInOnUpDate=TRUE;
CString str;
GetWindowText(str);
// reject invalid characters from str
SetWindowText(str);
m_bInOnUpDate=FALSE;
}
(Actually, either of these two techniques would suffice alone.) As a quality of implementation issue, you can also treat the selection (the highlithed portion) of the edit box and make it consistent with your "purged" string. Use GetSel/SetSel for this. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo