Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3042

fie info

$
0
0
Somewhere in the code below is causing this error(ACCESS TO $RECYCLE.BIN$ WAS DENIED), not letting me get file info TO populate a list control.

Code:

        pFILEINFO fiInfo = new( FILEINFO );

HANDLE hFile = CreateFile(fdFind.cFileName, GENERIC_READ, FILE_SHARE_READ, NULL,
        OPEN_EXISTING, 0, NULL);

GetLastWriteTimes( hFile, szBuf, MAX_PATH );

pFile = new CFile(fdFind.cFileName,
        CFile::modeRead);
    LONGLONG dwLength = pFile->GetLength();
BOOL bWorking = finder.FindFile(fdFind.cFileName);

bWorking = finder.FindNextFile();
finder.GetCreationTime(tempTime);
   
        str2 = tempTime.Format(_T("%c"));
     


CString str;
      str.Format(_T("%I64u KB"), dwLength /1024 );


finder.GetCreationTime(tempTime );
     



       

                                                lvItem.iItem        = iNum;
                                                lvItem.iImage        = siInfo.iIcon;
                                                lvItem.lParam        = ( LPARAM )fiInfo;
                                               
                               
                                        int nIndex = m_list.InsertItem(&lvItem);

                m_list.SetItemText(nIndex,1,szBuf);
                                        m_list.SetItemText(nIndex,2,str);

        m_list.SetItemText(nIndex,3,str2);

I type a directory in a edit control..ex(c:/users) crontol then hit a button to populate the list control..........to be precise of what im doing.

Viewing all articles
Browse latest Browse all 3042

Trending Articles