Okay, I created a resource-only DLL and I am trying to make an application that can load an image from it, such as a bitmap or icon.
Here is my DLL code:
#pragma managed(push, off)
BOOL APIENTRY DllMain(HMODULE hModule,
DWORD ul_reason_for_call, LPVOID lpReserved)
Then Here is the Resource file include with it:
This all compiles perfectly to a DLL. Then I can't seem to figure out how to load it into my project correctly.
ICON_MAIN ICON "icon.ico"
Here is the code I use to load the icon image:
The program compiles without error if I remove the LoadIcon line, so that is my problem I suppose. When I try to compile I get the error:
const char* pFileName="resdll.dll";
HMODULE hinstdll = LoadLibrary(pFileName);
HICON myicon = LoadIcon(hinstdll,ICON_MAIN);
"error C2065: 'ICON_MAIN' : undeclared identifier"
How can I fix this?