0

I'm trying to load a file from the resource table at runtime using:

/*resource.h*/
#define ID_UI_Cmd 175
/*XXX.rc*/
ID_UI_Cmd  EXAMPLES DISCARDABLE    "res\\Examples\\example.asp"


LPCTSTR lpszResourceName = MAKEINTRESOURCE (uiID);
//uiID == ID_UI_Cmd (..edited)
ASSERT(lpszResourceName != NULL);
HINSTANCE hInst = AfxFindResourceHandle(lpszResourceName, _T("Examples"));
HRSRC hRsrc = ::FindResource(hInst, lpszResourceName, _T("Examples"));
DWORD werror = GetLastError();
//werror == 1813
if (hRsrc == NULL)//always null
{
    ASSERT(FALSE);//always excuted
}

I've checked that the branch "EXAMPLES" in resource viwer is in Quotes.

werror == 1813
4

0 回答 0