Hard to say without seeing your code, but in order to preserve the output line breaks, your going to need to buffer the pipe data.
For example
- in a single read you get: "CHKDSK is verifying files (stage 1 of"
- You then either (a) append this data directly to the memo or (b) use a temp stringlist, set the text with the data, and call AddStrings to the memo.
- you read again, and get: "3)..."#10#13
- you repeat step 2.
You end up with 3 lines that really should be one. Again, not sure if this is your case, but I CAN tell you that regardless of console dimensions, the CRLF gets read when reading from the pipe.
To correct, you should be buffering this data until (a) you get a LF (#10) or (b) the program is done. If (a), then copy what you have up to and including the line feed, then trim this text and THEN add to the memo. Then delete the buffer up to and including the line feed, and wait for more data. When the progam is done, if buffer is not empty, then add the final text to the memo (for cases where you don't get a final LF).
Russell
Main Topics
Browse All Topics





by: Geert_GruwezPosted on 2009-02-03 at 00:08:19ID: 23535023
did you use this approach ?
en-us/libr ary/ms6860 28(VS.85). aspx
http://msdn.microsoft.com/