AFX_IDP_PARSE_INT
is the id for a standard MFC error message (it's defined in afxres.h), but in my project it fails to load, meaning that LoadString
returns FALSE
, GetLastError
returns ERROR_RESOURCE_NAME_NOT_FOUND
, and CString stays empty.
This happens even when I try loading it at the beginning of InitInstanse:
BOOL CMyLegacyProject::InitInstance()
{
CString string;
if (!string.LoadString(AFX_IDP_PARSE_INT))
AfxMessageBox(_T("Failed."));
}
This same code works on a new project, however - same linking of MFC (I link to it statically), same WINVER, I've tried making it as similar as my old project, but I can't reproduce the error on a newly started project.
It looks like your resources are not building correctly. Make sure your .rc file includes all the AFX resources as well. First I'd try building a brand new project from scratch, test loading the string in that, and then have a look to see what the default .rc file looks like.
It should be including a file called 'afxres.rc', ie your RC should have something like this in it: