FTPFindFirstFile problem using VBPointers 
Author Message
 FTPFindFirstFile problem using VBPointers

I am getting an error when I try to use FTPFindFirstFile with the VBPointers
library.  The CreateString is failing with a mismatch error.

Have also tried replacing the CreateString with the line:
strFileName = GetStringBuffAt(lngData32, 40)
Which uses the code from the discussion:
http://www.*-*-*.com/
but I get an "Unable to convert parameter 1 in function GetWordAt

Here is my code that uses the function:

Public Function FTPFirstFile(strFile As String) As String

    On Error Resume Next
    Dim lngData32 As Long
    Dim strFileName

    strFileName = ""
    lngData32 = AllocPointer(560)

    lngFindFile = FtpFindFirstFile(lngFtpHandle, strFile, lngData32,
INTERNET_FLAG_RELOAD, 0)
    If Err.Number <> 0 Or lngFindFile = 0 Then
        MsgBox "FTPFindFirstFile failed " & _
            vbCrLf & Err.Description
        Err.Clear
    End If

    Call CreateString(lngData32 + 40, 200, strFileName)
    If Err.Number <> 0 Or lngFindFile = 0 Then
        MsgBox "CreateString failed: " & strFileName & _
            vbCrLf & Err.Description
        Err.Clear
    End If

    Call FreePointer(lngData32)
    If Err.Number <> 0 Or lngFindFile = 0 Then
        MsgBox "Failed to find file: " & strFileName & _
            vbCrLf & Err.Description
        FTPFirstFile = ""
        Err.Clear
    Else
        FTPFirstFile = strFileName
    End If

End Function

Does anyone see the problem?

Thanks,
Steve



Sat, 05 Feb 2005 04:19:52 GMT  
 FTPFindFirstFile problem using VBPointers
I am getting an error when I try to use FTPFindFirstFile with the VBPointers
library.  The CreateString is failing with a mismatch error.

Have also tried replacing the CreateString with the line:
strFileName = GetStringBuffAt(lngData32, 40)
Which uses the code from the discussion:
http://forums.devbuzz.com/tm.asp?m=13693&p=1
but I get an "Unable to convert parameter 1 in function GetWordAt

Here is my code that uses the function:

Public Function FTPFirstFile(strFile As String) As String

    On Error Resume Next
    Dim lngData32 As Long
    Dim strFileName

    strFileName = ""
    lngData32 = AllocPointer(560)

    lngFindFile = FtpFindFirstFile(lngFtpHandle, strFile, lngData32,
INTERNET_FLAG_RELOAD, 0)
    If Err.Number <> 0 Or lngFindFile = 0 Then
        MsgBox "FTPFindFirstFile failed " & _
            vbCrLf & Err.Description
        Err.Clear
    End If

    Call CreateString(lngData32 + 40, 200, strFileName)
    If Err.Number <> 0 Or lngFindFile = 0 Then
        MsgBox "CreateString failed: " & strFileName & _
            vbCrLf & Err.Description
        Err.Clear
    End If

    Call FreePointer(lngData32)
    If Err.Number <> 0 Or lngFindFile = 0 Then
        MsgBox "Failed to find file: " & strFileName & _
            vbCrLf & Err.Description
        FTPFirstFile = ""
        Err.Clear
    Else
        FTPFirstFile = strFileName
    End If

End Function

Does anyone see the problem?

Thanks,
Steve



Sat, 05 Feb 2005 04:19:52 GMT  
 FTPFindFirstFile problem using VBPointers
I am getting an error when I try to use FTPFindFirstFile with the VBPointers
library.  The CreateString is failing with a mismatch error.

Have also tried replacing the CreateString with the line:
strFileName = GetStringBuffAt(lngData32, 40)
Which uses the code from the discussion:
http://forums.devbuzz.com/tm.asp?m=13693&p=1
but I get an "Unable to convert parameter 1 in function GetWordAt

Here is my code that uses the function:

Public Function FTPFirstFile(strFile As String) As String

    On Error Resume Next
    Dim lngData32 As Long
    Dim strFileName

    strFileName = ""
    lngData32 = AllocPointer(560)

    lngFindFile = FtpFindFirstFile(lngFtpHandle, strFile, lngData32,
INTERNET_FLAG_RELOAD, 0)
    If Err.Number <> 0 Or lngFindFile = 0 Then
        MsgBox "FTPFindFirstFile failed " & _
            vbCrLf & Err.Description
        Err.Clear
    End If

    Call CreateString(lngData32 + 40, 200, strFileName)
    If Err.Number <> 0 Or lngFindFile = 0 Then
        MsgBox "CreateString failed: " & strFileName & _
            vbCrLf & Err.Description
        Err.Clear
    End If

    Call FreePointer(lngData32)
    If Err.Number <> 0 Or lngFindFile = 0 Then
        MsgBox "Failed to find file: " & strFileName & _
            vbCrLf & Err.Description
        FTPFirstFile = ""
        Err.Clear
    Else
        FTPFirstFile = strFileName
    End If

End Function

Does anyone see the problem?

Thanks,
Steve



Sat, 05 Feb 2005 04:22:31 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Using FTPFindFirstFile

2. Problem with FtpFindFirstFile on OS390

3. Problem with ftpfindfirstfile and OS/390

4. VBPointers

5. FtpFindFirstFile API and LastWriteTime

6. ftpfindfirstfile strange behaviour

7. FtpFindFirstFile & canonicalized file names

8. FtpFindFirstFile Being Difficult

9. Error 12003 : FtpFindFirstFile (WinInet API)

10. FtpFindFirstFile don't work with space?

11. FtpFindFirstFile Daylight Saving Time Bug

12. FtpFindFirstFile help...please

 

 
Powered by phpBB® Forum Software