MCPcopy Create free account
hub / github.com/cinience/RedisStudio / GetText

Method GetText

DuiLib/Control/UIRichEdit.cpp:1207–1230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1205}
1206
1207CDuiString CRichEditUI::GetText() const
1208{
1209 long lLen = GetTextLength(GTL_DEFAULT);
1210 LPTSTR lpText = NULL;
1211 GETTEXTEX gt;
1212 gt.flags = GT_DEFAULT;
1213#ifdef _UNICODE
1214 gt.cb = sizeof(TCHAR) * (lLen + 1) ;
1215 gt.codepage = 1200;
1216 lpText = new TCHAR[lLen + 1];
1217 ::ZeroMemory(lpText, (lLen + 1) * sizeof(TCHAR));
1218#else
1219 gt.cb = sizeof(TCHAR) * lLen * 2 + 1;
1220 gt.codepage = CP_ACP;
1221 lpText = new TCHAR[lLen * 2 + 1];
1222 ::ZeroMemory(lpText, (lLen * 2 + 1) * sizeof(TCHAR));
1223#endif
1224 gt.lpDefaultChar = NULL;
1225 gt.lpUsedDefChar = NULL;
1226 TxSendMessage(EM_GETTEXTEX, (WPARAM)&gt, (LPARAM)lpText, 0);
1227 CDuiString sText(lpText);
1228 delete[] lpText;
1229 return sText;
1230}
1231
1232void CRichEditUI::SetText(LPCTSTR pstrText)
1233{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected