Код:
#include <Windows.h>
#include <iostream>
#include <fstream>
using namespace std;
void __cdecl Log(char *string, ...)
{
char a[512];
ofstream log;
SYSTEMTIME time;
GetLocalTime(&time);
log.open("Adeon.log",ios::app);
sprintf_s(a, "[%02d:%02d:%02d.%03d] %s",time.wHour, time.wMinute, time.wSecond, time.wMilliseconds, string);
log << a << endl;
log.close();
}
bool _stdcall DllMain(HMODULE hWnd, DWORD dwReason, PVOID pvReserved)
{
if(dwReason == DLL_PROCESS_ATTACH)
{
Log("Loaded.");
}
else if(dwReason == DLL_PROCESS_DETACH)
{
Log("Unloaded.");
}
return true;
}
Автор: xN4ME
Источник: http://adeon.org/forum/showtopic/49-c-sozdanie-biblioteki-dll