现在的位置: 首页 > 综合 > 正文

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

2013年02月19日 ⁄ 综合 ⁄ 共 399字 ⁄ 字号 评论关闭
在联机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类),就会产生几个的如题的警告信息。

抱歉!评论已关闭.