创建一个单文档或者多文档工程之后,会自带CPropertiesWnd属性窗口,使用过程中点了关闭,发现不能在显示了,关闭工程重新打开也不行。必须把相关代码注释掉才可以。
后来问百度,可以用ShowPane解决,以下是我的处理过程:
1.View部分,点击之后消息函数里写
CMainFrame* pMainFrame = (CMainFrame*)AfxGetMainWnd();
CPropertiesWnd* myWndProperties = pMainFrame->GetPropertiesWnd();
myWndProperties->ShowPane(true, false, false);
myWndProperties->InitPropList();
2.MainFrame里加函数声明
public:
CPropertiesWnd* GetPropertiesWnd();
3.添加函数实现
CPropertiesWnd* CMainFrame::GetPropertiesWnd()
{
CPropertiesWnd* pView = &m_wndProperties;
return pView;
}
4.解决。