示例#1
0
void TMainDlg::WriteErrLogNormal()
{
	EnableErrLogFile(TRUE);

	WriteLogHeader(hErrLog);
	WriteErrLogCore();
	WriteLogFooter(hErrLog);

	EnableErrLogFile(FALSE);
}
示例#2
0
void TMainDlg::WriteErrLogAtStart()
{
	EnableErrLogFile(TRUE);

	::GetLocalTime(&startTm);
	WriteLogHeader(hErrLog);

	if (!errBufOffset) {
		DWORD	len;
		char	*msg = "Initialize Error (Can't alloc memory or create/access DestDir)\r\n";

		::WriteFile(hErrLog, msg, (DWORD)strlen(msg), &len, 0);
	}

	EnableErrLogFile(FALSE);
}
示例#3
0
void TMainDlg::WriteErrLogNoUI(const char *msg)
{
	EnableErrLogFile(TRUE);

	WriteLogHeader(hErrLog);

	DWORD	len, size;
	len = (DWORD)strlen(msg);

	::WriteFile(hErrLog, msg, len, &size, 0);
	::WriteFile(hErrLog, "\r\n\r\n", 4, &size, 0);

	if (::AttachConsole(ATTACH_PARENT_PROCESS)) {
		HANDLE	hStdErr = GetStdHandle(STD_ERROR_HANDLE);
		Wstr	wmsg(msg);
		::WriteConsoleW(hStdErr, L"FastCopy: ", 10, &size, 0);
		::WriteConsoleW(hStdErr, wmsg.s(), (DWORD)wcslen(wmsg.s()), &size, 0);
		::WriteConsoleW(hStdErr, L"\r\n\r\n", 4, &size, 0);
	}

	EnableErrLogFile(FALSE);
}
示例#4
0
void TMainDlg::WriteErrLogAtStart()
{
	EnableErrLogFile(TRUE);

	::GetLocalTime(&startTm);
	WriteLogHeader(hErrLog);

	if (!errBufOffset) {
		if (!ti.errBuf) {
			ti.errBuf = fastCopy.GetErrBuf();
			errBufOffset = (int)ti.errBuf->UsedSize();
		}
		if (errBufOffset) {
			WriteErrLogCore();
		}

		char  *msg = "Initialize Error\r\n\r\n";
		DWORD len = (DWORD)strlen(msg);
		::WriteFile(hErrLog, msg, len, &len, 0);
	}

	EnableErrLogFile(FALSE);
}