Jump to content


Photo

onTransferProgress and events in VB6


  • Please log in to reply
1 reply to this topic

#1 avmar

avmar
  • Members
  • 3 posts

Posted 26 October 2006 - 04:32 AM

I've made pretty good progress with the VB6 sample code in the past couple of days. I've managed to get good multi file uploads and download working well.

I want to monitor file upload and download progress but I cannot get the ' Dim WithEvents objFTP As FTPConnectionSTA' and associated code to work in VB6.

I want to stay in VB6 because of the reduced requirement on my clients to have .NET on their computers.

Could you shed some light on making that VB6 example code work with onTransferProgress?

When I use Dim WithEvents objFTP As FTPConnectionSTA with the example code I get a compiler error ("Only valid in object module."). In the example that is the only module.

I also don't see in the VB6 example how and where to attach the events and where to put the onTransferProgress event code.

Thanks for all of your help. Based on what I've got done already there's little doubt we'll be purchasing very soon.

Thanks for all of your help.

...steve

#2 mb

mb

    Developer

  • Administrators
  • 11528 posts
  • Gender:
    Male
  • Location:
    Worldwide

Posted 26 October 2006 - 07:02 AM

I have to admit that we don't have VB6 installed anymore as it conflicted with other applications. But I've found the following article which explains how to use events in VB6:
http://www.developer...cle.php/1430631

Try the following:
Public WithEvents objFTP As sfFTPLib.FTPConnectionSTA

...

' Event handler
Private Sub objFTP_OnTransferProgress(ByVal nBytesTransferredLo As as Integer, ByVal nBytesTransferredHi As as Integer)
  Call MsgBox("OnTransferProgress")
End Sub


Please let me know about your results. Thank you.

Regards,
-Mat




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users