   Loading Resources From DLLs Help
  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:#include "stdafx.h"#ifdef _MANAGED#pragma managed(push, off)#endifBOOL APIENTRY DllMain(HMODULE hModule,    DWORD ul_reason_for_call, LPVOID lpReserved)    {    return TRUE;    }#ifdef _MANAGED#pragma managed(pop)#endifThen Here is the Resource file include with it:ICON_MAIN ICON "icon.ico"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:const char* pFileName="resdll.dll";HMODULE hinstdll = LoadLibrary(pFileName);HICON myicon = LoadIcon(hinstdll,ICON_MAIN);FreeLibrary(hinstdll);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]
  where do you define ICON_MAIN? Make sure its included in the file where your trying to call that LoadIcon line. Is it in your "stdafx.h" ?[edit]Ok I see you have it in your resource.h, but are you sure thats being included correctly?[/edit]   ;  Well, the way I included it is how I show here...  So I am not sure if it is right or not, but can someone help plz.   ;  you have to define ICON_MAIN in your program too not just you dll   ;  Ok well now I get it to compile but the program doesn't successfully load the icon...  why is this?  i don't get any errors but I tried using it as the window's small icon and it doesn't display my icon, just some other default.   