|
-
May 31st, 1999, 01:07 PM
#1
CFile
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.
-
May 31st, 1999, 01:20 PM
#2
Re: CFile
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.
-
June 1st, 1999, 10:33 AM
#3
Re: CFile
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.
-
June 1st, 1999, 11:46 AM
#4
Re: CFile
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.
-
June 1st, 1999, 12:41 PM
#5
Re: CFile
thank you. that is good to have people like you (specialist).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|