Im trying to populate a list control with the filename and maybe some other thing when i push the OK button
here is my code
When i push ok, no files get loaded. I also attached a imageCode:void CThisDlg::OnOK() { int iItem = 0, iActualItem = 0; HANDLE hFind; WIN32_FIND_DATA data2; int iNum = 0; hFind = FindFirstFile("*.*", &data2); if (hFind != INVALID_HANDLE_VALUE) { while (FindNextFile(hFind, &data2)){ if ( data2.dwFileAttributes == FILE_ATTRIBUTE_ARCHIVE ) { testing *node = new testing(); node->strFileName = data2.cFileName; LV_ITEM lvi; lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM; lvi.iItem = iNum; lvi.iSubItem = 0; lvi.iImage = I_IMAGECALLBACK; lvi.pszText = LPSTR_TEXTCALLBACK; lvi.lParam = reinterpret_cast<LPARAM>(node); lvi.cchTextMax = MAX_LVITEMLEN; m_list.InsertItem(&lvi); m_list.SetItemText(iItem, 0, LPSTR_TEXTCALLBACK); iNum++; } } } }


Reply With Quote
Bookmarks