Solved

Save and load unicode text files

Posted on 2000-05-03
1
771 Views
Last Modified: 2013-11-20
How do I save and load unicode text files in MFC using doc/view?
0
Comment
Question by:stl
1 Comment
 
LVL 23

Accepted Solution

by:
chensu earned 50 total points
ID: 2775695
If your application is built for Unicode version only (the UNICODE macro is defined), you can simply use CArchive::WriteString and CArchive::ReadString with Unicode strings. If your application is built for both Unicode and ANSI version, you need to use CArchive::Write and CArchive::Read.

WCHAR lpwsz[] = L"abc";
ar.Write(lpwsz, lstrlenW(lpwsz) * sizeof(WCHAR));
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now