Made a question from the answer comment: Populating the ListView in C ++ (@HashCode).

Thank you, I figured out the filling, but another error came out, which I can’t cope with at the moment, you may know how to fix it, I did this:

LVITEM item; memset(&item, 0, sizeof(LVITEM)); item.mask = LVIF_TEXT | LVIF_COLUMNS | LVIF_COLFMT; for (int i = 1; i< = 3; i++) { item.pszText = myBaseData.GetP[i]; item.iItem = i; ListView_InsertItem(GetDlgItem(hdlg, IDC_LIST1), &item); } int BaseData::GetP(int i) { return P[i]; } 

error C3867: 'BaseData :: GetP': function call missing argument list; use '& BaseData :: GetP' to create a pointer to member

I read in the internet that the static method should be done, but it does not work.

  • @ Maxim Ignatiev Dear participant, we have converted your comment into a new question in accordance with the forum format. - Nicolas Chabanovsky

1 answer 1

The error indicates that the argument list is not specified in the function call. In line

 item.pszText = myBaseData.GetP[i]; 

instead of square brackets it is necessary to put round:

 item.pszText = myBaseData.GetP(i); 

The current code is treated as taking the index at the function address with all the consequences.