#include "stdafx.h"
#include <afxdllx.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#ifdef _PGL_TRACE_LOG
CStdioFile logerror;
#endif
static AFX_EXTENSION_MODULE PGLDLL = { NULL, NULL };
extern "C" int APIENTRY
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
UNREFERENCED_PARAMETER(lpReserved);
if (dwReason == DLL_PROCESS_ATTACH)
{
TRACE0("PGL_D.DLL Initializing!\n");
if (!AfxInitExtensionModule(PGLDLL, hInstance))
return 0;
#ifdef _PGL_TRACE_LOG
logerror.Open( "PGLLog.txt", CFile::modeCreate | CFile::modeWrite | CFile::typeText );
PGL_TRACE("PGL.DLL Log file -- To monitor what's happening in Release version...\n");
PGL_TRACE("---------------------------------------------------------------------\n\n");
#endif
new CDynLinkLibrary(PGLDLL);
}
else if (dwReason == DLL_PROCESS_DETACH)
{
TRACE0("PGL_D.DLL Terminating!\n");
AfxTermExtensionModule(PGLDLL);
}
return 1;
}