ON_EN_CHANGE works differently on different computers, Why?
Posted on 2006-04-05
I am developing code that will examine each character entered into a CEdit Control, and do some processing. such as
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
jj=DoSomeProcessingOnBuffer(); where the buffer contents are potentially changed, and jj is the new length
My problem is that on my computer (Windows 2000), the function is not recursive. That is to say that when the function calls SetWindowText(), the EN_CHANGE message isn't sent again---at least it doesn't present itself. On a different Windows 2000 computer, the SetWindowText() function triggers another message, and ultimately there is a stack overflow because it gets caught in a recursive loop.
I suppose that the best way to fix it is to set a BOOLEAN as in BOOL Updating, and at the beginning of the function do something like
But why does it work differently on different computers running what I believe is that same OS.
Any information will be greatly appreciated.