Click here to Skip to main content
14,767,619 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
void Ccustom::log(CString val)
ofstream ofstream_object;
		ofstream_object.open(ApplicationPath, std::ios_base::app);
		Instance=(Ccustom*)pObject;
		CStringA stime(currentTime());
		logtime=stime.AllocSysString();		
		logmsg=val.AllocSysString();
		Instance->Fire_Log(logtime,logmsg);
		SysFreeString(logtime);
		SysFreeString(logmsg);		
		CString logInfo;
		logInfo.Format("%s  :   %s",stime,val);	
		ofstream_object<<logInfo <<'\n';	
		ofstream_object.close();	
		val.Empty();
		logInfo.Empty();
		stime.Empty();
Posted
Updated 20-Jun-14 3:33am
v4
Comments
[no name] 20-Jun-14 7:48am
   
Very nice code dump. At least you formatted it, thank you. Did you maybe have some sort of a question or description of some sort of a problem related to this code?
Member 10718181 20-Jun-14 7:52am
   
How do I create a day wise log file in Visual C++
Richard MacCutchan 20-Jun-14 8:47am
   
What exactly is "a day wise log file"?
Member 10718181 20-Jun-14 9:04am
   
log file generate this format every day time 00.00 started a log
20130304.log
20130305.log
20130306.log
20130307.log
20130308.log
Richard MacCutchan 20-Jun-14 9:36am
   
So what is your problem?
Member 10718181 20-Jun-14 10:12am
   
i need that format file save
Richard MacCutchan 20-Jun-14 10:56am
   
What does that mean?

If you need help with something then provide a proper detailed description of what you have done and what you are having a problem with. Alternatively you can look at some of the CodeProject articles that deal with the subject you are interested in.

But if you want soemone else to write the code for you you are at the wrong place.
[no name] 20-Jun-14 9:01am
   
In addition to explaining what this "day wise log file" is, you might want to tell us what you have tried and describe a problem with your code. Unless you want a direct answer to your question "How do I create a day wise log file in Visual C++" for which the answer is: write some code.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900