activex 实现中将mfc使用方式从共享 DLL使用 转换到静态库中使用 关于AFX_IDS_UNTITLED 的问题
The exception fires when trying to load the string AFX_IDS_UNTITLED in the following code at docsingl.cpp:
void CSingleDocTemplate::SetDefaultTitle(CDocument* pDocument)
{
CString strDocName;
if (!GetDocString(strDocName, CDocTemplate::docName) || strDocName.IsEmpty())
{
// use generic 'untitled'
ENSURE(strDocName.LoadString(AFX_IDS_UNTITLED));//The exception fires
}
pDocument->SetTitle(strDocName);
}
解决办法:
1) 将程序中所有的资源文件中 的LANGUAGE改为:LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
2)如果1的方法不行,可能就是因为你使用的是较早期的visual studio ,可在资源文件中加入#include "afxres.rc"