I have a dialog that contains three spreadsheets of the class CSpreadSheet. I was trying to use the following export function to export the data to a text file:

BOOL CSpreadSheet::ExportToTextFile(LPCTSTR FileName, LPCTSTR CellDelim, LPCTSTR ColDelim, LPCTSTR RowDelim, long Flags, LPCTSTR LogFile);

My code currently looks something like this:

m_Page1.m_patchSummary.ExportToTextFile(fileName, L"", L" / ", L"\r", 0, L"log.txt");
m_Page2.m_patchSummary.ExportToTextFile(fileName, L"", L" / ", L"\r", 0, L"log.txt");
m_Page3.m_patchSummary.ExportToTextFile(fileName, L"", L" / ", L"\r", 0, L"log.txt");

The problem is that each export overwrites the file. Is there a flag or other parameter I can use so that the data is appended to the text file, rather than overwriting it?

Thanks.

Recommended Answers

All 2 Replies

This is not a standard MFC class so you will have to read the docs from wherever you got it. Most likely from here.

I found a flag (OF_READWRITE) which did the trick. Thanks for your help.

Incidentally, I am using Farpoint Spread 6.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.