winapivisual-c++mfcclistctrl

What is the use of CListCtrl::GetItemData()?


Can anybody please help me to know, what is the use of CListCtrl::GetItemData() in MFC, VC++ ?

I went through MSDN description but it was not clear enough.

If anybody can provide a brief explanation and some example it will be really great and would help a lot.


Solution

  • The item data allows you to associate any data you want to each item of your list control. This data is most of the time a pointer to some data structure.

    For example in an email application you have a list control containing all received emails. Each item contains for example the sender, the subject and the date. The item data would contain a pointer to some data structure which contains the whole mail text amoung other information.