我在显示输出时遇到问题。每当我显示输出而不是多行输出时,我只会得到单行输出。
这是我当前的代码:
int TextLength = GetWindowTextLength(GetEditControl) + 1;
TCHAR Text[100000];
GetWindowText(GetEditControl, Text, TextLength);
if(TextLength > 1) {
vector <string> filelist;
string path;
path = Text;
path = stripPath(path);
filelist = GetPath(path);
stringstream buffer;
copy(filelist.begin()+1, filelist.end(),ostream_iterator<string>(buffer, "\n"));
SetWindowText(EditShow,buffer.str().c_str());
for(unsigned i=0;i<=99999;i++)
{
Text[i]='\0';
}
} else
{
MessageBox(NULL, "No Text", "Error", MB_OK | MB_ICONERROR);
}
这是编辑框的属性
EditShow = CreateWindowEx(0, TEXT("Edit"), NULL,
WS_CHILD | WS_VISIBLE | WS_BORDER | ES_AUTOHSCROLL ,
60, 70, 400, 150,
GetWindow, (HMENU)ID_EDITSHOW, NULL, 0);
最佳答案
尝试指定“\r\n”来分隔字符串,而不仅仅是“\n”。
关于c++ - Win32C++编辑框下一行问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5320636/