Original Post
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: 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. 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: "error C2065: 'ICON_MAIN' : undeclared identifier" How can I fix this? [Edited by - FWGaming on December 7, 2005 11:02:33 PM]
#include "stdafx.h"
#ifdef _MANAGED
#pragma managed(push, off)
#endif
BOOL APIENTRY DllMain(HMODULE hModule,
DWORD ul_reason_for_call, LPVOID lpReserved)
{
return TRUE;
}
#ifdef _MANAGED
#pragma managed(pop)
#endif
ICON_MAIN ICON "icon.ico"
const char* pFileName="resdll.dll";
HMODULE hinstdll = LoadLibrary(pFileName);
HICON myicon = LoadIcon(hinstdll,ICON_MAIN);
FreeLibrary(hinstdll);