現象
在VS2010中調試SDI程序出現如下告警:
Warning: no message line prompt for ID 0x8015.
Warning: no message line prompt for ID 0x8016.
解決方法
1、在 resource.h文件 中找到該ID。
#define IDT_SELECT 32790
2、在 資源管理器 中,找到該資源屬性,在 Prompt項目中添加 提示字符串。
原因
微軟在 winfrm.cpp文件 中有如下代碼。
void CFrameWnd::GetMessageString(UINT nID, CString& rMessage) const
{
// load appropriate string
LPTSTR lpsz = rMessage.GetBuffer(255);
if (AfxLoadString(nID, lpsz) != 0)
{
// first newline terminates actual string
lpsz = _tcschr(lpsz, '\n');
if (lpsz != NULL)
*lpsz = '\0';
}
else
{
// not found
TRACE(traceAppMsg, 0, "Warning: no message line prompt for ID 0x%04X.\n", nID);
}
rMessage.ReleaseBuffer();
}