急!如何在theApp中得到CMainFrame?

cauiot 2003-10-20 08:35:39
void CGraphicsApp::OnTools()
{
CWnd* pWnd = this->GetMainWnd();
pWnd->m_wndToolsDlg.ShowWindow(TRUE);
}

好像是错的。
...全文
50 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
cauiot 2003-10-20
  • 打赏
  • 举报
回复
void CGraphicsApp::OnTools()
{
CMainFrame *pFrm = (CMainFrame *)this->GetMainWnd();
pFrm->m_wndToolsDlg.ShowWindow(TRUE);
}

果然 如此.好!
yt老顽童 2003-10-20
  • 打赏
  • 举报
回复
(CMainFrame*)(theApp.m_pMainFrame)
ripyu 2003-10-20
  • 打赏
  • 举报
回复
(CMainFrame*)AfxGetMainWnd();
你的也没有错,错在可能m_wndToolsDlg无效
wuxfBrave 2003-10-20
  • 打赏
  • 举报
回复
void CGraphicsApp::OnTools()
{
(CMainFrame *)pFrm = (CMainFrame *)this->GetMainWnd();
pFrm->m_wndToolsDlg.ShowWindow(TRUE);
}

你取到的需要转换一下

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧