I want to create a Log file in MFC that should write to log file everytime it should append the logging details , it should not overrite the exisiting details.And there should be some size limit like if after this much size a new file should create.
How to achieve this?
any help is appreciated.
Thanks.
Look at the CStdioFile Class, specifically the method CStdioFile::WriteString. It makes it easy to write text to a file.
When you open the file you want to combine the
CFile::modeCreateandCFile::modeNoTruncateflags to create the file only if it doesn’t exist already.You can get the size of the file using the CFile::GetLength method.