此代码在Visual C++ 6.0下工作:
BOOL CSplashWnd::PreTranslateAppMessage(MSG *pMsg)
{
if (c_pSplashWnd == NULL)
return FALSE;
// If we get a keyboard or mouse message, hide the splash screen.
if ((pMsg->message == WM_KEYDOWN) ||
(pMsg->message == WM_SYSKEYDOWN) ||
(pMsg->message == WM_LBUTTONDOWN) ||
(pMsg->message == WM_RBUTTONDOWN) ||
(pMsg->message == WM_MBUTTONDOWN) ||
(pMsg->message == WM_NCLBUTTONDOWN) ||
(pMsg->message == WM_NCRBUTTONDOWN) ||
(pMsg->message == WM_NCMBUTTONDOWN))
{
// let main frame window remove the splash screen so timer is killed &
// Tip-of-the-Day is displayed (if appropriate)
CMainFrame *pWnd = (CMainFrame *) AfxGetMainWnd();
pWnd->RemoveSplash();
return TRUE; // message handled here
}
return FALSE; // message not handled
}
Run Code Online (Sandbox Code Playgroud)
现在在Visual Studio 2017中,我收到以下错误消息:
错误C2039:'RemoveSplash':不是'CMainFrame'的成员
当我在MSDN中搜索RemoveSplash时,我没有点击...
这曾经是CMainFrame或CFrameWnd的一部分吗?有任何想法吗?
小智 8
CMainFrame从来不是MFC的一部分,而是VS向导为您生成的框架窗口的默认名称.换句话说,这是自定义代码.
问题是“为什么……?” 好吧,您不得不问微软的某个人,我怀疑他们会知道。您询问的是1998年发布的产品(6.0)。19年前。自那时以来发生了许多变化。更好的C ++标准一致性,支持Unicode的操作系统等。
自1995年以来,我一直在为MFC编程。我不记得MFC中有内置的启动窗口。有人将这样的成员添加到CMainFrame类中,因为它不是MFC的一部分。它可能派生自CFrameWnd或CMDIFrameWnd。在旧的VC ++项目中查看MainFrm.h。
| 归档时间: |
|
| 查看次数: |
78 次 |
| 最近记录: |