-
August 1st, 1999, 09:06 PM
#1
Different results in Debug/Release Version
Hi, there are different results between Debug and Release Version in the following code. I want to the reason. Why ?
void CMyListview::OnClick(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
CString itemText = pListCtrl->GetItemText(pNMListView->iItem, 0) ;
if ( !itemText.IsEmpty())
{
LVITEM lvitem ;
lvitem.mask = LVIF_TEXT | LVIF_IMAGE | LVIS_SELECTED ;
lvitem.iItem = pNMListView->iItem ;
lvitem.iSubItem = 0 ;
lvitem.stateMask = LVIS_SELECTED ;
if ( pListCtrl->GetItem( &lvitem ))
{
// Never run to here in Debug Version. Why ?
}
}
*pResult = 0;
}
-
August 1st, 1999, 09:59 PM
#2
Re: Different results in Debug/Release Version
One thing I notice is that LVIS_SELECTED is not a valid parameter for lvitem.mask. I would also zero init the structure before using it.
memset(&lvitem, 0, sizeof(LV_ITEM).
HTH,
Chris
-
August 2nd, 1999, 11:02 AM
#3
Re: Different results in Debug/Release Version
Great job ! It works very well !
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|