如何正确地将包含Cview的CDockablePane添加到CMDIChildWndEx? [英] how to correctly add CDockablePane containing a Cview to a CMDIChildWndEx?

查看:192
本文介绍了如何正确地将包含Cview的CDockablePane添加到CMDIChildWndEx?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述









我用我试图复制的例子创建了一个github存储库: https://github.com/rcitaliano/TestDockChild


我正在尝试创建一个包含CView派生类的CDockablePane,然后将CDockablePane停靠到CMDIChildWndEx(子框架)而不是CMDIFrameWndEx(主框架)。

I'm trying to create a CDockablePane, that contains a CView derived class, and then dock the CDockablePane to a CMDIChildWndEx (child frame) instead of the CMDIFrameWndEx (main frame).


我这样做是因为在一个"真实"项目中我试图做同样的事情并且它不起作用。

I've done this because in a "real" project I'm trying to do the same thing and it's not working.


在真实项目中,当我尝试关闭子框架时,应用程序崩溃会导致堆损坏异常,而在我创建应用程序的示例中,当您关闭时,应用程序不会崩溃子框架,但内部视图无法正常工作,因为它不是
刷新。

In the real project, when I try to close the child frame, the app crashes giving a heap corruption exception, while in the example I've created the app doesn't crashes when you close the child frame, but the view inside doesn't work correctly because it's not refreshing.


我在这里不知所措,我尝试了很多东西,但没有任何效果,我找不到微软的官方在线信息。

I am at a loss here, I have tried lots of stuff but nothing worked, and I couldn't find any official online infos from microsoft.


有没有人知道这个?

has anyone any clue about this?

推荐答案

你好rcitaliano,

Hi rcitaliano,

感谢您在此发帖。

据我所知,当前视图将被刷新,因为视图处于活动状态。

As far as I know that the current view will be refreshed, because the view is active.

我已根据您的搜索结果从您的代码中下载了您的代码。我找不到有关刷新视图的相关代码。

I have downloaded your code, based on my search result from your code. I cannot find out relevant code about refreshing view.

我建议您使用
CDocument :: UpdateAllViews 
方法更新所有观点。

I suggest that you use the CDocument::UpdateAllViews method to update all views.

由于您的代码很复杂,我不知道您想要的结果是什么,请提供更多信息。

Since your code is complex, I don't know what the result is you want, please provide more information.

最好的问候,

Hart


这篇关于如何正确地将包含Cview的CDockablePane添加到CMDIChildWndEx?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆