Thank for the replies.
It is actually not a bug, I figured it out. This is a little subtle :)
LVITEM.mask
(probably whole LVITEM struct) should be independently applied for every subitems. My mistake in above code is that I didnt reset
lvi.mask
.
so here is (at least in my case) a working version.
m_lstCtrl.InsertColumn(0, L"First name" , LVCFMT_LEFT, onePercent * 35);
m_lstCtrl.InsertColumn(1, L"Middle name", LVCFMT_CENTER, onePercent * 35);
m_lstCtrl.InsertColumn(2, L"Last name", LVCFMT_LEFT, onePercent * 30);
LVITEM lvi;
lvi.mask = LVIF_TEXT | LVIF_PARAM ;
lvi.iItem = 0;
lvi.iSubItem = 0;
lvi.lParam = 100;
lvi.pszText =L"First";
m_lstCtrl.InsertItem(&lvi);
lvi.mask = LVIF_TEXT;
lvi.iSubItem = 1;
lvi.pszText = L"Middle";
m_lstCtrl.SetItem(&lvi);
lvi.mask = LVIF_TEXT;
lvi.iSubItem = 2;
lvi.pszText = L"Last";
m_lstCtrl.SetItem(&lvi);
Quy