Problem: ResourceHandle defaults to InstanceHandle, so using resources in Dll will fail.
Solution: Switch the ResourceHandle to the instance handle of the dynamic library, and switch back to the current instance handle after using the resource.
//Switch from exe to dll, then switch from dll to exe HINSTANCE hExe = AfxGetResourceHandle(); HINSTANCE hDll = AfxGetInstanceHandle(); hDll = ::GetModuleHandleA("KqGisFrame.dll"); AfxSetResourceHandle(hDll); CHelloDlg dlg;//The resource of the dialog is located in the dynamic library; dlg.DoModal();//But the default is to run the instance when loading resources; AfxSetResourceHandle(hExe);//So switch