b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

c 中cformview头文件_cformview_base class undefined(3)

电脑杂谈  发布时间:2017-02-17 08:40:24  来源:网络整理

CFrameWnd* pParentFrame = GetParentFrame();

if (pParentFrame != NULL)

{

// eat it if this will cause activation

ASSERT(pParentFrame == pDesktopWnd ||pDesktopWnd->IsChild(pParentFrame));

// either re-activate the current view, or set this view to beactive

CView* pView = pParentFrame->GetActiveView();

HWND hWndFocus = ::GetFocus();

if (pView == this &&

m_hWnd != hWndFocus && !::IsChild(m_hWnd, hWndFocus))

{

// re-activate this view

OnActivateView(TRUE, this, this);

}

else

{

// activate this view

pParentFrame->SetActiveView(this);

}

}

return nResult;

}

另外,在CView::PostNcDestroy(),实现了CView类的自我销毁,这是因为CView类是可以动态生成的(DECLARE_DYNCREATE/IMPLEMENT_DYNCREATE)。

// self destruction

void CView::PostNcDestroy()

{

// default for views is to allocate them on the heap

//the default post-cleanup is to ‘delete this‘.

//never explicitly call ‘delete‘ on a view

delete this;

基本上,修改了CView继承类的这几个地方,直接返回不要调用基类相应的成员函数,就可以在对话框上使用。

下面举例,用向导生成对话框应用程序,对话框类为CMyDigalog。

从CHTMLView类继承一个CHTMLCtrl类,建立相应的消息处理函数并修改以下几个地方:

// CHTMLCtrl 消息处理程序

int CHTMLCtrl::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINTmessage)

{

// TODO: 在此添加消息处理程序代码和/或调用默认值

return CWnd::OnMouseActivate(pDesktopWnd, nHitTest, message);

//return CHtmlView::OnMouseActivate(pDesktopWnd,nHitTest, message);

}

void CHTMLCtrl::OnDestroy()

{

//CHtmlView::OnDestroy();

// TODO: 在此处添加消息处理程序代码

c  中cformview头文件_base class undefined_cformview

CWnd::OnDestroy();

}

void CHTMLCtrl::PostNcDestroy()

{

// TODO: 在此添加专用代码和/或调用基类

//CHtmlView::PostNcDestroy();

}

void CHTMLCtrl::OnActivateFrame(UINT nState, CFrameWnd*pDeactivateFrame)


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-32922-3.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    • 贾曾
      贾曾

      谋求战略均衡点

    • 晋愍帝
      晋愍帝

      中国军队尤其海军必须始终头顶国耻心记仇恨

    • 尚开亮
      尚开亮

      此时此刻特别怀念毛主席

    热点图片
    拼命载入中...