David Flores
March 19th, 1998, 11:48 AM
In using the CListCtrl enchanements from this site, I have found that 'Highlighting A Row' and 'Editable Subitems' are not compatiable.
Problem:
In CMyListCtrl::SetOnFocus(CWnd *pOldWnd)
{
if (pOldWnd != NULL && pOldWnd->GetParent() == this)
return;
//more...
}
The GetParent() call produces an error because pOldWnd is not a valid window anymore, it was already destroyed in the CInPlaceEdit::OnKillFocus
Solution:
1) Comment out the DestoryWindow() command in CInPlaceEdit::OnKillFocus
2) Change CMyListCtrl::SetOnFocus(CWnd *pOldWnd)
CMyListCtrl::SetOnFocus(CWnd *pOldWnd)
{
if (pOldWnd != NULL && pOldWnd->GetParent() == this)
{
pOldWnd->DestroyWindow();
return;
}
// More...
}
Problem:
In CMyListCtrl::SetOnFocus(CWnd *pOldWnd)
{
if (pOldWnd != NULL && pOldWnd->GetParent() == this)
return;
//more...
}
The GetParent() call produces an error because pOldWnd is not a valid window anymore, it was already destroyed in the CInPlaceEdit::OnKillFocus
Solution:
1) Comment out the DestoryWindow() command in CInPlaceEdit::OnKillFocus
2) Change CMyListCtrl::SetOnFocus(CWnd *pOldWnd)
CMyListCtrl::SetOnFocus(CWnd *pOldWnd)
{
if (pOldWnd != NULL && pOldWnd->GetParent() == this)
{
pOldWnd->DestroyWindow();
return;
}
// More...
}