如何删除从clistctrl继承的列表 [英] How to delete a list that inherits from clistctrl
问题描述
我有一个从clistctrl继承的基类,另一个在我的类中继承的类.
I have a base class that inherits from clistctrl and another class that inherits in my class.
class list:Clistctrl
class listgenrator:list
我有一个来自基类的指针,该指针写在初始化对话框中:
I have a pointer from base class that writes in initialize dialog:
list =new listgenerator();
当在析构函数对话框中删除列表时,我在destroywindow Clist中有一个断言错误,该声明位于行pmap-> lookupPremanent(m_hwnd)
when deleting list in destructor dialog I have an assertion error in destroywindow Clist the asertion is in line pmap->lookupPremanent(m_hwnd)
推荐答案
当析构函数中的删除列表出现断言错误
when delete list in destractor i have a assertion error
哪个析构函数和什么是断言?
从上面我假设您的意思是在CListctrl析构函数中,但是我不确定.我还假设您得到m_hwnd为NULL的断言,但是我不确定.您可能正在销毁某个窗口,然后再次调用DestroyWindow().尝试使用调试器跟踪您在派生类中的工作.
Which destructor and what is the assertion?
From the above I am assuming you mean in the CListctrl destructor but I cannot be sure. I also assume you get an assertion that m_hwnd is NULL, but again I cannot be sure. It is possible that you are destroying some window and then calling DestroyWindow() again. Try using the debugger to trace through what you are doing in your derived classes.
通常,这是应用对话框的可视属性的好地方
OnInitDialog()
中的m_hWnd
已经有效
并将其降级为OnDestroy()
-m_hWnd
仍然有效:)
Usually it is a good place to apply the visual properties of a dialog
in itsOnInitDialog()
-m_hWnd
is already valid
and to degrade them in itsOnDestroy()
-m_hWnd
is still valid :)
这篇关于如何删除从clistctrl继承的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!