// JP opened flex table

Click to See Complete Forum and Search --> : Fix: CListCtrl Editable subitems and row selection


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...

}

Paul Reynolds
April 6th, 1998, 08:13 AM
Yeah...I came across the same problem...I just added a line to the setfocus:


if(pOldWnd != NULL && IsWindow(pOldWnd->m_hWnd) && pOldWnd->GetParent() == this)

return;

//JP added flex table