I am working on a MFC project with multiple GUI applications. The objective is to move all the resources from individual projects to a single resource dll.
After some change I have a single resource-only dll project and multiple GUI project. Each GUI project is using the following code to access the resource dll:
BOOL CFooApp::InitInstance()
{
HINSTANCE hRes = NULL;
hRes = LoadLibrary(_T("Resource.dll"));
if(hRes) AfxSetResourceHandle(hRes);
....
So far things work fine except there are two issues:
- The GUI exe files lose there icons in Windows explorer. Although there are some MFC boilerplate code that load the icon from IDR_MAINFRAME, that only affects the icon in the top of the application window.
- The Class Wizard won't work anymore. For example I can no longer click on a dialog button in the resource view to add a button handler?
How to solve these issues?