I am trying to select all the items in a list control, but the below code doesn't seem to work... Can anyone tell me what I am missing?

int num_items = m_List.GetItemCount();


for (int i = 0; i < num_items; i++)
m_List.SetItem(i, 0, LVIF_STATE, NULL, 0, LVIS_SELECTED, LVIS_SELECTED, 0);




Thanks,
Jaime