Gaetan Emond
May 31st, 1999, 01:07 PM
Hi every one, i wish you are doing good. I would like to know if it is possible to do an append with the class CFile to put more record in 1 file after you restart the application.
|
Click to See Complete Forum and Search --> : CFile Gaetan Emond May 31st, 1999, 01:07 PM Hi every one, i wish you are doing good. I would like to know if it is possible to do an append with the class CFile to put more record in 1 file after you restart the application. Hurol Aslan May 31st, 1999, 01:20 PM Hello, I don't recall that CFile class has an append mode, but I think you can open one with CFile::modeWrite | CFile::modeNoTruncate mode so that the file won't be destroyed if it exists. Then you can seek the end of file with SeekToEnd() method and write new stuff in the file. Gaetan Emond June 1st, 1999, 10:33 AM Thank you really much. Now, how do i open the file. It is giving me an error message when i am trying to open it. Hurol Aslan June 1st, 1999, 11:46 AM Hello again, If the error occurs when you are trying to reopen the file, it may be because you have not closed it after you first opened it. Otherwise, check what the error is. The Open method of CFile class lets you provide a pointer as the third argument to find out what the error is, or you can use a try/catch block: try{ YourFile.Open(.....) } catch(CFileException fileError) { AfxMessageBox("Something wrong!"); ... } Exactly what was wrong can be found in the data members of the CFileException object thrown by the Open method. Gaetan Emond June 1st, 1999, 12:41 PM thank you. that is good to have people like you (specialist). codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |