List Control Column data
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 14 of 14

Thread: List Control Column data

Threaded View

  1. #1
    Join Date
    Nov 2012
    Posts
    21

    List Control Column data

    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
    Code:
    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++;
    }
    
    	}
    }
     
    }
    When i push ok, no files get loaded. I also attached a image
    Attached Images Attached Images  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center