Forum guidelines
AuthorQuestion
ActiveX in vb6.0
Posted By Ashish Sharma on 28 Dec 2007

Hi Experts,

I had created an actiex on which on clicking a button it will display the browse folder path and on selecting a particular location the application shd display all the files in that folder and subfolder but

in my document There are 13,457 files, 7.42 GB(Got information thru windows property) but the app stops at 6393 files, 7517.33 mb.  So not sure what is causing the limitation

does reading of file through activex depends upon the user priviliges


AuthorReply
Re: ActiveX in vb6.0
Posted By Scott Lysle on 28 Dec 2007  

Please post an example showing how the control works; maybe it is not going into the subdirectories or something like that.  It is impossible to know from the description.


slysle
Re: ActiveX in vb6.0
Posted By Ashish Sharma on 28 Dec 2007  

code is working fine for some directory if i select a folder in my d:\abcfolder i m getting excat number of file and there size, but on some other case i m not getting the excat value.

Is this because of some "hidden folder" within sub directory or for some file permission is not there to access them,

putting a code is some what complicated

Public Sub TraverseDirectories(ByVal clsDir As Collection, ByVal vCollectionCounter As Variant)
On Error GoTo td_error:
Dim str As String
Dim str1 As String
Dim sDirName As String, sTempPath As String, sPathToTraverse As String


    sPathToTraverse = clsDir.Item(vCollectionCounter)
    sDirName = Dir(sPathToTraverse, vbDirectory)
        Do While sDirName <> ""   ' Start the loop.
            ' Ignore the current directory and the encompassing directory.
            If sDirName <> "." And sDirName <> ".." Then
                ' Use bitwise comparison to make sure sDirName is a directory.
                If (GetAttr(sPathToTraverse & sDirName) And vbDirectory) = vbDirectory Then
                    ' Display entry for directory...
                    countfolder = countfolder + 1
                    strfolders(countfolder) = sPathToTraverse & sDirName & "\"
                    sTempPath = sPathToTraverse & sDirName & "\"
                    clsDir.Add sTempPath
                Else
                    'create a collection of all files ...
                    'frmDirs.lstDisplay.AddItem (sPathToTraverse)
                    'frmDirs.lstDisplay.AddItem (sDirName)
                   
                    str1 = sDirName
                   
                   
                End If
            End If
            'Get next entry...
            sDirName = Dir
        Loop
    vCollectionCounter = vCollectionCounter + 1
    Call TraverseDirectories(clsDir, vCollectionCounter)
    Exit Sub
td_error:
        'break out of the loop
        Exit Sub
 
End Sub


SPONSORED BY

Custom Software Development
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.