27 #define TRACE_PRINTER(s) TRACE_PRINT(s)
29 #define TRACE_PRINTER(s)
37 bool check_DLL_versions();
40 static AFX_EXTENSION_MODULE SomeDLL = { NULL, NULL };
43 #define DLL_NAME "unnamed DLL"
46 extern "C" int APIENTRY
51 UNREFERENCED_PARAMETER(reserved);
53 char *dll_name = DLL_NAME;
59 static int dll_entry_count = 0;
62 case DLL_PROCESS_ATTACH: {
63 char *message = DLL_NAME
" Initializing!\n";
64 TRACE_PRINTER(message);
66 if (!check_DLL_versions())
return 0;
69 if (!AfxInitExtensionModule(SomeDLL, instance))
return 0;
72 dll_link =
new CDynLinkLibrary(SomeDLL);
85 case DLL_PROCESS_DETACH: {
87 char *message = DLL_NAME
" Terminating!\n";
88 TRACE_PRINTER(message);
92 AfxTermExtensionModule(SomeDLL);
95 case DLL_THREAD_ATTACH:
98 case DLL_THREAD_DETACH:
109 #elif defined(__WIN32__)
115 bool check_DLL_versions();
118 BOOL APIENTRY DllMain(
HANDLE module,
DWORD ul_reason_for_call, LPVOID reserved)
121 switch (ul_reason_for_call) {
122 case DLL_PROCESS_ATTACH:
123 if (!check_DLL_versions())
return 0;
127 case DLL_THREAD_ATTACH:
128 case DLL_THREAD_DETACH:
129 case DLL_PROCESS_DETACH:
#define NULL_POINTER
The value representing a pointer to nothing.
void WHACK(contents *&ptr)
deletion with clearing of the pointer.
Support for unicode builds.
Aids in achievement of platform independence.
void * application_instance
#define SET_INSTANCE_HANDLE(value)
use this to change the instance handle for this dll or exe.