我已经开发了一个动态库,在dll中我添加了两个资源文本文件,然后通过可执行文件我动态加载dll,当调用FindResource API到第一个时,它工作正常。现在我想要为了获得对另一个(即第二个)的引用,它给了我错误1814,即找不到资源名称。因为我有相同的资源类型,传递资源名称的不同参数(当我添加资源文件时生成的参数)。 我试过它可以执行它。
//代码
char sResNameDesign[5] = _T("#101");
char sResNameIM[5] = _T("#102");
//changes resource name to capital.
char sRestype[25] = _T("DESIGNXMLMAPPATH");
hMod = LoadLibrary("eastmoni.dll");
hresDesign = FindResource(hMod, sResNameDesign, sRestype);
hresIM = FindResource(hMod,sResNameIM,sRestype);
if (hresDesign == NULL || hresIM == NULL)
{
return RESOURCE_NOT_FOUND;
}
//.RC file
IDR_DESIGNXMLMAPPATH1 DESIGNXMLMAPPATH "..\\..\\Resources\\Design.map"
IDR_DESIGNXMLMAPPATH2 DESIGNXMLMAPPATH "..\\..\\Resources\\IMLookInfo.map"
//.Generated resource.h
#define IDR_DESIGNXMLMAPPATH1 101
#define IDR_DESIGNXMLMAPPATH2 102