MFC
Expand Minimize
This topic has not yet been rated - Rate this topic

CListCtrl::MapIDToIndex

Maps the unique ID of an item in the current list-view control to an index.

UINT MapIDToIndex(
     UINT id
) const;

Parameter

Description

[in] id

The unique ID of an item.

The current index for the specified ID.

A list-view control internally tracks items by index. This can present problems because indexes can change during the control's lifetime. The list-view control can tag an item with an ID when the item is created and you can use this ID to guarantee uniqueness during the lifetime of the list-view control.

Note that in a multithreaded environment the index is guaranteed only on the thread that hosts the list-view control, not on background threads.

This method sends the LVM_MAPIDTOINDEX message, which is described in the Windows SDK.

Header: afxcmn.h

This control is supported in Windows XP and later.

Additional requirements for this method are described in Build Requirements for Windows Vista Common Controls.

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.