Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with CFile!!!

Status
Not open for further replies.

sergelaurent

Technical User
Joined
May 30, 2005
Messages
52
Location
FR
I am actually using the CFile.open command to open a file. However, I would like to write in this file without replacing existing caracters.

Does anybody know in which mode I should open this File or I shoud use the seekToEnd command each time?
 
Open using [tt]CFile::modeCreate | CFile::modeNoTruncate | CFile::modeWrite[/tt] (or possibly, [tt]CFile::modeReadWrite[/tt], if that's what you need). Then you must do [tt]seekToEnd()[/tt] before writing to the file.
Hope this helps.
See: [URL unfurl="true"]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_mfc_cfile_class_members.asp[/url] for more information.

[tt]_______________________________________
Roger [pc2]
The Eileens are out there[/tt]
 
Thanks a lot woja!!!!

It works fine!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top