Clearing a CRichTextCtrl? Not in XP...
-
In this piece of code I expect a CRichEditCtrl to clear itself. It works fine in Win98, in XP nothing happens.
UpdateData(TRUE);
m_profileCtrl.UpdateData(TRUE);
m_profile.Empty();
m_profile.Delete(0,m_profile.GetLength());
m_profile = _T("");
m_profileCtrl.UpdateData(FALSE);
UpdateData(FALSE);Of course this piece of code is a bit overkill, yet it should work. :) Am I making some sort of stupid mistake, or can I safely blame XP? Also, is there another way to clear a text box properly? Cheers!
-
Try adding an
UpdateWindow
call at the end (though I thought it should work without it.) Joaquín M López Muñoz Telefónica, Investigación y DesarrolloI found it! You'll NEVER believe it, but the ONLY way to make it work was by setting the text to a space _T(" "); Unbelievable! Thanks for your quick answer though!
-
In this piece of code I expect a CRichEditCtrl to clear itself. It works fine in Win98, in XP nothing happens.
UpdateData(TRUE);
m_profileCtrl.UpdateData(TRUE);
m_profile.Empty();
m_profile.Delete(0,m_profile.GetLength());
m_profile = _T("");
m_profileCtrl.UpdateData(FALSE);
UpdateData(FALSE);Of course this piece of code is a bit overkill, yet it should work. :) Am I making some sort of stupid mistake, or can I safely blame XP? Also, is there another way to clear a text box properly? Cheers!
Try adding an
UpdateWindow
call at the end (though I thought it should work without it.) Joaquín M López Muñoz Telefónica, Investigación y Desarrollo -
I found it! You'll NEVER believe it, but the ONLY way to make it work was by setting the text to a space _T(" "); Unbelievable! Thanks for your quick answer though!
Hmmm... this does seem like a bug to me. Maybe someone else here can enlighten us. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
-
Hmmm... this does seem like a bug to me. Maybe someone else here can enlighten us. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
It was very odd, and frustrating, as I don't have XP myself. So I kept sending patches, but they didn't work :) - Griffith
-
In this piece of code I expect a CRichEditCtrl to clear itself. It works fine in Win98, in XP nothing happens.
UpdateData(TRUE);
m_profileCtrl.UpdateData(TRUE);
m_profile.Empty();
m_profile.Delete(0,m_profile.GetLength());
m_profile = _T("");
m_profileCtrl.UpdateData(FALSE);
UpdateData(FALSE);Of course this piece of code is a bit overkill, yet it should work. :) Am I making some sort of stupid mistake, or can I safely blame XP? Also, is there another way to clear a text box properly? Cheers!
Just a hunch; try it without misusing the
CString
object:CRichEditCtrl::SetWindowText( _T( "" ) );
Peace! -=- James. "Fat people are hard to kidnap." (Try Check Favorites Sometime!) -
Just a hunch; try it without misusing the
CString
object:CRichEditCtrl::SetWindowText( _T( "" ) );
Peace! -=- James. "Fat people are hard to kidnap." (Try Check Favorites Sometime!)That was about the first thing that came to mind with me, and much to my surprise that didn't work. Especially because the CRichEditCtrl::Clear(); fuction refused to work too.
-
That was about the first thing that came to mind with me, and much to my surprise that didn't work. Especially because the CRichEditCtrl::Clear(); fuction refused to work too.
Then that sounds like either (1) a serious bug in the RE Control, or (2) a redraw problem. Peace! -=- James. "Fat people are hard to kidnap." (Try Check Favorites Sometime!)