RICHEDIT_CLASS10A debugging and testing

Alban Browaeys prahal at
Tue Apr 17 13:04:27 CDT 2007


I am trying to build a test case for a bug I have with
RichEdit10ANSIWndProc called with EM_GETTEXTRANGE on
an editor with two newlines at the end of the range.

In such case ME_GetTextW is called with
editor->bEmulateVersion10 which does nChars--;. In the
case of a newline nChars is 1 thus become 0 and -1 a
little while later when the code is : nChars-=nLen
(where nLen is 1 as we reach the end of the range on

My workaround is to add :
if (nChars == 1)
 nLen = 0;
after the editor->bEmulateVersion10 but
 I do not understand why it works (well except that
having nChars being -1 is bad) and if nLen-- without
the if nChars == 1 would be better.

So I am trying to add a test case to riched20 by
static HWND new_richedit10A(HWND parent) {
  return new_window(RICHEDIT_CLASS10A, ES_MULTILINE,

but this fails with an invalid handler error.

Could someone help me ?

Thank you

Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses

More information about the wine-devel mailing list