terrys398
asked on
Loading a Dialog Resource from a separate DLL
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:
MyDialog pDlg;
pDlg.DoModal();
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,F indResourc e(g_hresou rce, (const unsigned short *) IDD_MYDIALOG, RT_DIALOG));
LockResource(hGlbl);
MyDialog pDlg;
pDlg.InitModalIndirect(hGl bl);
pDlg.DoModal();
Now, any ideas on how to do this correctly?
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:
MyDialog pDlg;
pDlg.DoModal();
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,F
LockResource(hGlbl);
MyDialog pDlg;
pDlg.InitModalIndirect(hGl
pDlg.DoModal();
Now, any ideas on how to do this correctly?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.