File write displays as Hex

Hi,

I'm not getting proper line feeds or something, because when I view the file that I have written it displays as Hex. I'm writing with CStdioFile Write(), and writing to it with CString. I append \r\n to the end of the string.
Any ideas? Thanks.

CStdioFile srchOutput;
srchOutput.Open(srchOutputFileName, CFile::modeCreate | CFile::modeWrite | CFile::shareDenyNone);

while( srchItemLineCount >= 0 ) {
CString cstr_Srch = srchString[srchItemLineCount];
cstr_Srch += "\r\n";
srchOutput.Write(cstr_Srch.GetBuffer(cstr_Srch.GetLength()+1),cstr_Srch.GetLength()+1);

srchItemLineCount--;

}
What is a CStdioFile? Is that like a std::FILE*?

http://www.cplusplus.com/reference/clibrary/cstdio/FILE/

Your code doesn't look like C++ to me.

Maybe I'm in the wrong forum? It is an MFC file I/O library class.
Topic archived. No new replies allowed.