📄 subject_45718.htm
字号:
<p>
序号:45718 发表者:super_xxx_xxx 发表日期:2003-07-03 09:29:11
<br>主题:高分:关于CFormView, 在线等待!!!
<br>内容: 我在工程中加了一个CfrmView,点击菜单帮助-test会激活它,但是为什么这个formview只能接受键盘响应,不能接收鼠标消息?<BR><BR>
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:风之文章 回复日期:2003-07-04 13:30:43
<br>内容:在OnTest()内加上 <BR><BR> CRuntimeClass* pNewViewClass;<BR> pNewViewClass = RUNTIME_CLASS(CfrmView);<BR> CView* pOldActiveView=GetActiveView();///////////////NEW<BR> <BR> // create the new view<BR> CCreateContext context;<BR> context.m_pNewViewClass = pNewViewClass;<BR> context.m_pCurrentDoc = GetActiveDocument();<BR> CView* pNewView = STATIC_DOWNCAST(CView, CreateView(&context));<BR> if (pNewView != NULL)<BR> {<BR> // the new view is there, but invisible and not active...<BR> pNewView->ShowWindow(SW_SHOW);<BR> pOldActiveView->ShowWindow(SW_HIDE);//////////////////NEW<BR> pNewView->OnInitialUpdate();<BR> SetActiveView(pNewView);<BR> RecalcLayout();<BR> }
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:super_xxx_xxx 回复日期:2003-07-04 16:49:19
<br>内容:如果是多文档的工程,问什么异样的代码连编译都不通过?<BR>void CMainFrame::Ontest() <BR>{<BR> CRuntimeClass* pNewViewClass;<BR> pNewViewClass = RUNTIME_CLASS(CfrmView);<BR> <BR> // create the new view<BR> CCreateContext context;<BR> context.m_pNewViewClass = pNewViewClass;<BR> context.m_pCurrentDoc = GetActiveDocument();<BR> CfrmView* pNewView = STATIC_DOWNCAST(CfrmView, CreateView(&context));<BR> if (pNewView != NULL)<BR> {<BR> // the new view is there, but invisible and not active...<BR> pNewView->ShowWindow(SW_SHOW);<BR> pNewView->OnInitialUpdate();<BR> SetActiveView(pNewView);<BR> RecalcLayout();<BR> }<BR>------------------------------------------------------------------------------<BR>C:\temp\ffp1\l.jpn\aa\MainFrm.cpp(81) : error C2039: 'classCfrmView' : is not a member of 'CfrmView'<BR> c:\temp\ffp1\l.jpn\aa\frmview.h(13) : see declaration of 'CfrmView'<BR>C:\temp\ffp1\l.jpn\aa\MainFrm.cpp(81) : error C2065: 'classCfrmView' : undeclared identifier<BR>C:\temp\ffp1\l.jpn\aa\MainFrm.cpp(87) : error C2039: 'classCfrmView' : is not a member of 'CfrmView'<BR> c:\temp\ffp1\l.jpn\aa\frmview.h(13) : see declaration of 'CfrmView'<BR>C:\temp\ffp1\l.jpn\aa\MainFrm.cpp(92) : error C2039: 'OnInitialUpdate' : is not a member of 'CfrmView'<BR> c:\temp\ffp1\l.jpn\aa\frmview.h(13) : see declaration of 'CfrmView'<BR>C:\temp\ffp1\l.jpn\aa\MainFrm.cpp(93) : error C2664: 'SetActiveView' : cannot convert parameter 1 from 'class CfrmView *' to 'class CView *'<BR> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast<BR>Error executing cl.exe.<BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:风之文章 回复日期:2003-07-04 16:52:26
<br>内容:我是在你原有的基础上改的,我没有考虑你现在说的这个问题!
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:风之文章 回复日期:2003-07-04 16:54:54
<br>内容:你可以把最新的代码帖上来,我帮你看一下
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:super_xxx_xxx 回复日期:2003-07-07 09:21:54
<br>内容:谢谢热心的风之文章, 这是一个多文档工程,我不是很清楚怎样在多文档模式下操作formview, 还有我不清楚怎么销毁一个view,希望能得到解答。
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -