void WriteLog(char * szLog, int nError)
{
	SYSTEMTIME st;
	GetLocalTime(&st);
	FILE *fp;
	fp = fopen("D:\\log.txt", "at");
	fprintf(fp, "MyLogInfo: %d:%d:%d:%d, The Err Num is %d ", st.wHour, st.wMinute, st.wSecond, st.wMilliseconds, nError);
	fprintf(fp, szLog);
	fclose(fp);
	OutputDebugStringA(szLog);
}

调用方式:

WriteLog("************Test*************\n", nError);

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-05
  • 2021-07-18
猜你喜欢
  • 2022-12-23
  • 2022-01-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案