|
// EsiListenerCPP.cpp : Defines the entry point for the DLL application.
//
#include "stdafx.h"
#include <string>
#include "PipeClient.h"
PipeClient pipeClient;
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
void WINAPI Trace(char* szMessage)
{
char szAppPath[MAX_PATH] = "", dateTime[40] = {0};
std::string strAppName, strFileName, strMessage;
SYSTEMTIME st;
GetLocalTime(&st);
sprintf( dateTime, "%0000d/%00d/%00d %00d:%00d:%00d" ,st.wYear,st.wMonth,st.wDay,st.wHour,st.wMinute,st.wSecond);
::GetModuleFileName(0, szAppPath, MAX_PATH);
strAppName = szAppPath;
strAppName = strAppName.substr(strAppName.rfind("\\") + 1);
strMessage = strAppName;
strMessage += SEPARATOR;
strMessage += SEPARATOR;
strMessage += dateTime;
strMessage += SEPARATOR;
strMessage += szMessage;
pipeClient.Send( (char*)strMessage.data() );
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.