diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /utils/valvelib/valvelib.cpp | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'utils/valvelib/valvelib.cpp')
| -rw-r--r-- | utils/valvelib/valvelib.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/utils/valvelib/valvelib.cpp b/utils/valvelib/valvelib.cpp new file mode 100644 index 0000000..dd0c795 --- /dev/null +++ b/utils/valvelib/valvelib.cpp @@ -0,0 +1,47 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +// +//=============================================================================// +// valvelib.cpp : Defines the initialization routines for the DLL. +// + +#include "stdafx.h" +#include <afxdllx.h> +#include "valvelib.h" +#include "valvelibaw.h" + +#ifdef _PSEUDO_DEBUG +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +static AFX_EXTENSION_MODULE ValvelibDLL = { NULL, NULL }; + +extern "C" int APIENTRY +DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) +{ + if (dwReason == DLL_PROCESS_ATTACH) + { + TRACE0("VALVELIB.AWX Initializing!\n"); + + // Extension DLL one-time initialization + AfxInitExtensionModule(ValvelibDLL, hInstance); + + // Insert this DLL into the resource chain + new CDynLinkLibrary(ValvelibDLL); + + // Register this custom AppWizard with MFCAPWZ.DLL + SetCustomAppWizClass(&Valvelibaw); + } + else if (dwReason == DLL_PROCESS_DETACH) + { + TRACE0("VALVELIB.AWX Terminating!\n"); + + // Terminate the library before destructors are called + AfxTermExtensionModule(ValvelibDLL); + } + return 1; // ok +} |