【MFC】Warning: no message line prompt for ID 0x8015.

現象

在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();
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章