I think your problem is in the interpretation on the "\n" character. The CArchive class treats this DIFFERENTLY than the CStdioFile class. You want it interpreted as a NEWLINE rather than a binary "\n" character. So, as AlexFM says, use a class to output it that properly translates this pseudo-character to what you really want in the output file.

Alternatively, you can output a "raw" CR LF pair using the hex values 0x0D and 0x0A.

Note that your use of CArchive is INAPPROPRIATE here! To QUOTE the SDK:

"The CArchive class allows you to save a complex network of objects in a permanent binary form ..."

You are attempting to use CArchive to save a TEXT file as TEXT. CArchive is opening the output file in "BINARY" mode and so all data being sent to it is "RAW". You want "\n" to NEWLINE conversion in effect so you should use CStdioFile() instead OR do it manually youself.

Exception Handling is in the core of any application that is able to dignify its name.
In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.

Internet Business Fax to Email Made Easy -
With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number.
You'll receive secure faxes in your email, fr…