Different results in Debug/Release Version
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Different results in Debug/Release Version

  1. #1
    Join Date
    May 1999
    Posts
    8

    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;
    }


  2. #2
    Join Date
    May 1999
    Posts
    667

    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


  3. #3
    Join Date
    May 1999
    Posts
    8

    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
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center