Sunday, August 13, 2006

CNumEdit bug

A CNumEdit bug was discovered While attempting to compensate Time Blur's parameter for master pitch: CNumEdit notifies the parent before the aux window (aux is a CEditSlider in this case). The parent (a row dialog) sends a notification via SendMessage instead of PostMessage, and since the recipient (main frame) reads the value from the slider, the value is stale, because the slider hasn't been updated yet. The symptom: if a parameter is edited by typing text in the edit control and pressing tab, the slider moves to correct position, but the plugin doesn't respond to the change. The solution: CNumEdit should notify the aux window first, then the parent.

This is also a problem in Whorld, but it's masked because CMasterDlg::OnNotify uses PostMessage. Using SendMessage causes the same bug to appear. With the corrected CNumEdit, CMasterDlg::OnNotify can use SendMessage without problems. This is preferrable since SendMessage is theoretically more efficient.

No comments: