继承setactiveview问题 [英] Inherit setactiveview issue
问题描述
你好,
我在VS NET 2003上用C ++编写了一个旧的MFC项目,我有以下问题。
我的项目是一个SDI,我把SplitterWnd放到两个视图中。
我想检测视图激活更改以执行一些激活/停用。
因为它似乎与我正在寻找的完全一致,我试图在我的CMainFrame中继承CFrameWnd :: SetActiveView(CView * pViewNew,BOOL bNotify)(公共派生自CFrameWnd)在公共场合如下:
in .h:
public:
void SetActiveView(CView * pViewNew, BOOL bNotify = TRUE);
$ c $ b in .cpp:
void CMainFrame :: SetActiveView(CView * pViewNew,BOOL bNotify)
{
Beep(440,200);
CFrameWnd :: SetActiveView(pViewNew,bNotify);
}
我的函数从未调用过; CFrameWnd :: SetActiveView()仍然是被调用的那个。
也许,有一个消息处理程序或其他东西要添加?或者特定的限制/不兼容/错误?
它应该很简单,但是......
提前感谢您的帮助,
Eric
我的尝试:
继承CFrameWnd :: SetActiveView()
Hello,
I have an old MFC project in C++ on VS NET 2003 and I have the following issue.
My project is a SDI in which I put a SplitterWnd to have two views.
And I would like to detect view activation change to perform some activations/desactivations.
As it seems to correspond exactly to what I am looking for, I tried to inherit CFrameWnd::SetActiveView(CView* pViewNew, BOOL bNotify) in my CMainFrame (public derived from CFrameWnd) in public as follow:
in .h:
public:
void SetActiveView(CView* pViewNew, BOOL bNotify = TRUE);
in .cpp:
void CMainFrame::SetActiveView(CView* pViewNew, BOOL bNotify)
{
Beep (440, 200);
CFrameWnd::SetActiveView(pViewNew, bNotify);
}
And my function is never called; the CFrameWnd::SetActiveView() remains the one which is called.
Perhaps, there is a message handler or something else to add? or a specific limitation/incompatibility/bug?
It should be easy, but...
Thank you in advance for your help,
Eric
What I have tried:
Inherit CFrameWnd::SetActiveView()
推荐答案
查看文档: CFrameWnd类 [ ^ ],这不是虚函数,这意味着它不可覆盖。
Looking at the documentation: CFrameWnd Class[^], this is not a virtual function, which means it is not overridable.
这篇关于继承setactiveview问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!