Solved

Save and load unicode text files

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 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

13 Experts available now in Live!

Get 1:1 Help Now