Solved

Save and load unicode text files

Posted on 2000-05-03
1
787 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

820 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