开发者

Problem in Next Line in Edit Box in Win32C++

I'm having a problem where in displaying my output. Whenever I display the output instead of having multiple lines of output i only got single line output.

Here is my Current code:

int TextLength = GetWindowTe开发者_如何学JAVAxtLength(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);
}

this is the property of the Edit box

EditShow = CreateWindowEx(0, TEXT("Edit"), NULL,
            WS_CHILD | WS_VISIBLE | WS_BORDER | ES_AUTOHSCROLL ,
            60, 70, 400, 150,
            GetWindow, (HMENU)ID_EDITSHOW, NULL, 0);


Try specifying "\r\n" to separate the strings instead of just "\n".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜