fie info
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: fie info

Hybrid View

  1. #1
    Join Date
    Jun 2013
    Posts
    21

    fie info

    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.

  2. #2
    Join Date
    Jun 2013
    Posts
    21

    Re: fie info

    I narrowed it down...

    Code:
    pFile = new CFile(fdFind.cFileName,
             CFile::modeRead);
    that is the problem.i tried messing with the access..no luck

  3. #3
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,070

    Re: fie info

    $RECYCLE.BIN$ is a special folder with very restrictive access. In fact it makes a part of Recycle Bin functionality. It's usually hidden in Windows Explorer, and should be ignored/hidden in any kind of third party listing. Same to System Volume Information folder that is another system folder with very restrictive access.
    Best regards,
    Igor

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