Adding a Resource File to a Windows DLL
You must add the following lines to any dll module:
#include <windows.h>
#include <ilviews/macros.h>
extern "C" {
void _declspec(dllimport) IlvAddHandleToResPath(long, int);
void _declspec(dllimport) IlvRemoveHandleFromResPath(long);
}
BOOL WINAPI
DllEntryPoint(HINSTANCE instance, DWORD reason, LPVOID)
{
switch (reason) {
case DLL_PROCESS_ATTACH:
IlvAddHandleToResPath((long)instance, -1);
return 1;
case DLL_PROCESS_DETACH:
IlvRemoveHandleFromResPath((long)instance);
return 0;
}
return 0;
}
BOOL WINAPI
DllMain(HINSTANCE hinstance, DWORD reason, LPVOID reserved)
{
return DllEntryPoint(hinstance, reason, reserved);
}
Published date: 05/24/2022
Last modified date: 02/24/2022