C
Wenn man weiter liest, kommt da noch:
nMaxLength
Maximum number of characters that can be copied into lpszBuffer. The second form of GetLine places this value into the first word of the buffer specified by lpszBuffer.
Damit wird die Funktion zu:
///
int i, nLineLength, nLineCount = m_FehlerWarnungAusgabe.GetLineCount();
CString strText, strLine;
for (i=0;i < nLineCount;i++)
{
nLineLength = m_FehlerWarnungAusgabe.LineLength(i);
m_FehlerWarnungAusgabe.GetLine(i, strText.GetBuffer(nLineLength),/**/nLineLength);
strText.ReleaseBuffer(nLineLength);
strLine.Format(TEXT("line %d: '%s'\r\n"), i, strText.GetBuffer(0));
afxDump << strLine;
}
///
@Martin:
The copied line does not contain a terminating null character.
-> das heißt, du mußt entweder das \0 manuell noch anhängen oder die Größe direkt an ReleasBuffer() übergeben.