Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


CFile::Write question

Posted on 2004-10-21
Medium Priority
Last Modified: 2013-11-20
I have a SDI app w/ a listview. a property sheet will open, user will fill in the fields, and data goes to the listview and property sheet closes.
normally when using a listview i use the serialize function to save data, but i need to save listview data as plain text, so i tried to use CFile::Write method. the problem is when using
it only writes the last entry from m_edit1, unlike the serialize function which will save all the m_edit1 entries in the view. is there any way to achieve this using CFile::Write?
Question by:cheapstr
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 55

Accepted Solution

Jaime Olivares earned 1000 total points
ID: 12373961
You have to make a loop to write every item in the list view.
LVL 23

Expert Comment

by:Roshan Davis
ID: 12378092
open the file with the attribute CFile::modeNoTruncate
LVL 45

Expert Comment

ID: 12378265
Have a look at the code in the serialize function and make a duplicate of the IsSaving section but replace the lines ar<< xxxxx with your file.WriteString

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

618 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