If all bitmap IDs are unique (even in different DLLs), you should always be able to load a required bitmap successfully using one of the following methods:
bool CExtResourceManager::LoadBitmap(
CExtBitmap & _bitmap,
__EXT_MFC_SAFE_LPCTSTR strResourceName,
WORD * p_wLangIdOut, // = NULL
HINSTANCE * p_hInstOut // = NULL
)
bool CExtBitmap::LoadBMP_Resource(
__EXT_MFC_SAFE_LPCTSTR sResourceID,
__EXT_MFC_SAFE_LPCTSTR sResourceType, // = RT_BITMAP // default bitmap section
HINSTANCE hInst, // = NULL // find it automatically
bool bMake32, //= false
bool bEnableThrowException // = false
)
If bitmap resource identifiers are not equal in each of DLLs and in EXE, you should detect manually which DLL (or EXE) contains the required bitmap resource and use the following method:
bool CExtBitmap::LoadBMP_Resource(
HINSTANCE hInst,
HRSRC hRsrc,
bool bMake32, //= false
bool bEnableThrowException // = false
)
You can define and use
IDC_EDIT1
in several different DLL and EXE projects. It’s defined in the
resource.h
header file of each project. If A.DLL project includes into its
.CPP files only its own
resource.h
file, then you will not come across with any problems. If your DLL projects will include
resource.h
file from different projects, then you will not be able to compile successfully because some of resource constants will be defined more than once using different values. This is incorrect and you can avoid this problem only by using unique names in resource pre-processor variables.