problem with CListView and lParam 
Author Message
 problem with CListView and lParam

Hi!

I do like this to set lParam to 500
m_listCtrl.InsertItem(LVIF_TEXT|LVIF_STATE|LVIF_PARAM, 0, "Test",
                                LVIS_SELECTED, LVIS_SELECTED, 0, 500);

then I have
void CListCtrlView::OnDblclkList(NMHDR* pNMHDR, LRESULT* pResult)
{
 // TODO: Add your control notification handler code here
 NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
pNMListView->lParam // doesn't contain right value.
...

Quote:
}

I'm not sure how to check efter InserItem that the lParam is right.
Does anyone know why I don't get the right value from lParam?

thanks!
/Niklas



Sun, 24 Apr 2005 21:20:41 GMT  
 problem with CListView and lParam

Quote:
>I do like this to set lParam to 500
>m_listCtrl.InsertItem(LVIF_TEXT|LVIF_STATE|LVIF_PARAM, 0, "Test",
>                                LVIS_SELECTED, LVIS_SELECTED, 0, 500);

>then I have
>void CListCtrlView::OnDblclkList(NMHDR* pNMHDR, LRESULT* pResult)
>{
> // TODO: Add your control notification handler code here
> NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
>pNMListView->lParam // doesn't contain right value.
>...
>}

>I'm not sure how to check efter InserItem that the lParam is right.
>Does anyone know why I don't get the right value from lParam?

Niklas,

Tee documentation for "NM_DBLCLK (list view) Notification" says:

"The iItem, iSubItem, and ptAction members of this structure contain
information about the item."

which implies that the lParam isn't available.

Try calling the GetItemData method and see if that works.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq



Mon, 25 Apr 2005 01:32:42 GMT  
 problem with CListView and lParam
Thanks!
that was a tricky one for me to figure out, but now it works!

/Niklas


Quote:
> >I do like this to set lParam to 500
> >m_listCtrl.InsertItem(LVIF_TEXT|LVIF_STATE|LVIF_PARAM, 0, "Test",
> >                                LVIS_SELECTED, LVIS_SELECTED, 0, 500);

> >then I have
> >void CListCtrlView::OnDblclkList(NMHDR* pNMHDR, LRESULT* pResult)
> >{
> > // TODO: Add your control notification handler code here
> > NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
> >pNMListView->lParam // doesn't contain right value.
> >...
> >}

> >I'm not sure how to check efter InserItem that the lParam is right.
> >Does anyone know why I don't get the right value from lParam?

> Niklas,

> Tee documentation for "NM_DBLCLK (list view) Notification" says:

> "The iItem, iSubItem, and ptAction members of this structure contain
> information about the item."

> which implies that the lParam isn't available.

> Try calling the GetItemData method and see if that works.

> Dave
> --
> MVP VC++ FAQ: http://www.mvps.org/vcfaq



Mon, 25 Apr 2005 11:20:15 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Information about the function OnHelpHitTest(WPARAM, LPARAM lParam)

2. lParam member of LV_ITEM in CListCtrl problem

3. Invalidate problem in CListView

4. Scroll problem in CListView

5. Problems with tooltip for CListView

6. I have a problem in making CListView Class.

7. Problem with LVN_ITEMCHANGING notification in CListView

8. problem Handling Click and double click messages in CListView

9. A problem about CListView

10. CListView - CImageList - problems ?!?!?!

11. CListView problem with sorted columns

12. CListView/CListCtrl Load-time performance problem

 

 
Powered by phpBB® Forum Software