Looks like it happens when the event is fired.
Here is the code. I edited your demo
I get this error with using 1.0.1.20 (first one I started using) till the newest version.
with the the link you sent is this somthing I will have to do on my end or do you need to change something in the dll?
If it's something I need to do I'll have to spend a while trying to figure it out. This still is a little new to me. I'm used to working with ocx and not to many dll's
Thanks for responding so quickly
'Method used in demo
'Public objFTP As sfFTPLib.FTPConnection
'method used by me
'This works inside VB but once compiled to an exe causes a crash
Dim WithEvents objFTP As FTPConnection
Private Sub Form_Load()
'method used by me
'This works inside VB but once compiled to an exe causes a crash
Set objFTP = New FTPConnection
' VB6 binding howto
' http://kandkconsulting.tripod.com/VB/Tutorials/vb_binding_tutorial.htm
'Early Binding "Dual Interface"
'Note: Force the compiler to use the dual interface if available
Set objFTP = CreateObject("sfFTPLib.FTPConnection")
'Early Binding "Mid Level"
'Note: The compiler may use the dual interface
'Set objFTP = New sfFTPLib.FTPConnection
objFTP.Host = "ftp.smartftp.com"
objFTP.Port = 21
objFTP.Protocol = ftpProtocolNormal
objFTP.Username = "anonymous"
objFTP.Password = "test@test.com"
objFTP.Passive = True
objFTP.LogFile = "VB6Demo.log"
If objFTP.Connect = sfFTPLib.enumError.ftpErrorSuccess Then
MsgBox ("Connected.")
If objFTP.ChangeDirectory("/SmartFTP") = sfFTPLib.enumError.ftpErrorSuccess Then
MsgBox ("ChangeDirectory() successful.")
' Read Directory
If objFTP.ReadDirectory() = sfFTPLib.enumError.ftpErrorSuccess Then
MsgBox ("ReadDirectory() successful.")
Dim objDirectory As sfFTPLib.FTPDirectory
Set objDirectory = objFTP.Directory
Dim objItem As sfFTPLib.FTPItem
Dim strList
For Each objItem In objDirectory
strList = strList & "Type=" & objItem.Type & "; Name=" & objItem.Name & "; Size=" & objItem.Size32 & vbCrLf
Next
MsgBox (strList)
Else
MsgBox ("ReadDirectory() failed. LastError = " & objFTP.LastError)
End If
' Download File
Dim nRestart
nRestart = 0
Dim strMsg
If objFTP.DownloadFile32("History.txt", "History.txt", nRestart) = sfFTPLib.enumError.ftpErrorSuccess Then
strMsg = "DownloadFile() successful." & vbCrLf
strMsg = strMsg & "LastTransferBytes = " & objFTP.LastTransferBytes32 & " B" & vbCrLf
strMsg = strMsg & "LastTransferTime = " & objFTP.LastTransferTime & " s" & vbCrLf
strMsg = strMsg & "LastTransferSpeed = " & objFTP.LastTransferSpeed & " B/s"
MsgBox (strMsg)
Else
strMsg = "DownloadFile() failed. LastError = " & objFTP.LastError & vbCrLf
strMsg = strMsg & "LastReplyCode = " & objFTP.LastReplyCode & vbCrLf
strMsg = strMsg & "LastReply = " & objFTP.LastReply & vbCrLf
MsgBox (strMsg)
End If
Else
MsgBox ("ChangeDirectory() failed. LastError = " & objFTP.LastError)
End If
Else
MsgBox ("Connect() failed. LastError = " & objFTP.LastError)
End If
End Sub
Private Sub objFTP_OnTransferProgress32(ByVal nBytesTransferred As Long)
Label1.Caption = nBytesTransferred
End Sub