event when loading a dll
-
Hi, I've created a dll (C++) containing several functions, which are used inside an Excel-VBA-Project via dll-calls. What I want: when the dll is loaded into memory (i.e. when one of the functions is executed first time), a general function should be executed (purpose: check licence information etc.). Is there an event, which is triggered when the dll is loaded ? TIA M.
-
Hi, I've created a dll (C++) containing several functions, which are used inside an Excel-VBA-Project via dll-calls. What I want: when the dll is loaded into memory (i.e. when one of the functions is executed first time), a general function should be executed (purpose: check licence information etc.). Is there an event, which is triggered when the dll is loaded ? TIA M.
BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved ); fdwReason -> DLL_PROCESS_ATTACH -> The DLL is being loaded into the virtual address space of the current process as a result of the process starting up or as a result of a call to LoadLibrary. DLLs can use this opportunity to initialize any instance data or to use the TlsAlloc function to allocate a thread local storage (TLS) index.