梦书之家(移动开发)

你有一个苹果,我有一个苹果,我们交换一下,一人还是一个苹果;你有一个思想,我有一个思想,我们交换一下,一人就有两个思想。 ——肖伯纳

导航

Warning: calling DestroyWindow in CWnd::~CWnd; OnDestroy or PostNcDestroy in derived class will not be called.

在联机Debug的时候,在按程序“退出”的时候,会在OutPut窗口显示警告信息:
Warning: calling DestroyWindow in CWnd::~CWnd; OnDestroy or PostNcDestroy in derived class will not be called.

灵感来自:http://topic.csdn.net/t/20030919/10/2277589.html
试了好几个对象,得出的结论是:
如果在CAppView类的OnCreate中创建了一些窗口对象(派生自CWnd类),其他对象没有调用DestroyWindow()函数/方法,不会产生以上的警告信息,需要在CAppView类的析构函数OnDestroy函数中必须显式调用这些窗口对象的DestroyWindow()函数/方法。
另外,CAppView类创建的几个窗口对象(派生自CWnd类),就会产生几个的如题的警告信息。

posted on 2007-06-29 18:35  梦书  阅读(3678)  评论(0编辑  收藏  举报