Search code examples
c++mfccrichedit

MFC: Best way to get text from a CRichEdit?


I've got a CRichEdit that I need to get the text from. What is the best way to do that? GETTEXTEX? StreamOut? If I go the StreamOut approach, what would my callback look like?


Solution

  • It's inherited from CWnd so you should just be able to use GetWindowText().

    CString returnText;
    yourRichEdit.GetWindowText(returnText);