Loading a Dialog Resource from a separate DLL
Posted on 2003-03-04
I've browsed through many of the similar questions, and none seem to address this issue, so here it goes...
I'm trying to do the usual Internationalization task of separating the GUI resources from the code. I've compiled the resources into a separate DLL from the code that runs the GUI. (Note: I'm using MFC on Windows CE)
Typically, if the resources weren't in a different file, the code would look like this:
Since my code for MyDialog is in a different DLL, I've attempted the following, which must be incorrect since it doesn't work:
g_hresource = LoadLibrary (TEXT("resourceDLL.dll"));
HGLOBAL hGlbl = LoadResource(g_hresource,FindResource(g_hresource, (const unsigned short *) IDD_MYDIALOG, RT_DIALOG));
Now, any ideas on how to do this correctly?