#202 CSortListViewqCtrl doesn't empty m_arrColSortType on destroy

v1.0 (example)
closed-wont-fix
None
5
2014-03-21
2008-05-22
reebes
No

I create an instance of CSortListView in one dialog, then subclass the listview control on WM_INITDIALOG. And I want to create/show the dialog for many times. When I create it in the first time, it is ok. For the second time, error occusr on line 3514 of atlctrlx.h because m_arrColSortType was not cleaned on the previous destroy.

I think it should clear m_arrColSortType when listview was destroyed.

example:

CDialog
{
public:
CSortListViewCtrl m_lvw;

...

OnInitDialog(...)
{
m_lvw.SubclassWindow(GetDlgItem(IDC_LISTVIEW));
}

}

class CMainDlg
{
CDialog m_dlg;
OnButtonClick
{
m_dlg.Create(m_hWnd);
m_dlg.ShowWindow(SW_SHOW);
....
m_dlg.DestroyWindow();
m_dlg.Create(m_hWnd); // Error occurs!!!!!
m_dlg.ShowWindow(SW_SHOW);
....
m_dlg.DestroyWindow();
}
}

Discussion

    • assigned_to: Nenad Stefanovic
    • Group: --> v1.0 (example)
     
  • It could do that, but there is no real need. Just empty the array before sublcassing in OnInitDialog.

     
    • status: open --> closed-wont-fix