#include "stdafx.h" #include "ModemListbox.h" #include #include "stringutils.h" void CModemListbox::appendString(const std::string &str, int type) { StringList slist; //OutputDebugString(L"+listbox::appendStrng\n"); // first split string in lines size_t ppos= 0; while (ppos < str.length()) { size_t spos= str.find_first_of("\r\n\x02", ppos); if (spos==str.npos) break; size_t send= str.find_first_not_of("\r\n\x02", spos); if (send==str.npos) send= str.length(); slist.push_back(str.substr(ppos, send-ppos)); ppos= send; } if (ppos < str.length()) { slist.push_back(str.substr(ppos)); } size_t istring= 0; // then optionally extend the last unended line int last= GetCount()-1; int caret= GetCurSel(); if (last>=0 && istring setting to %d\n", last, caret, newlast); int rc= SetCurSel(newlast); } //OutputDebugString(L"-listbox::appendStrng\n"); }