Login  
Search All Forums
Dart Home | PowerTCP FTP for .NET | Custom Development Reply | PowerTCP FTP for .NET Topics | Forums   
AuthorForum: PowerTCP FTP for .NET
Topic: FTP progress event difficulty
kevininstructor
kevin.s.gallagher@state.or.us

From: Salem, OR USA
Posts: 16
Member Since: 10/12/04
posted May 23, 2005 11:19 AM

I created a class with an object within i.e.

Private WithEvents Ftp1 As New Dart.PowerTCP.SecureFtp.Ftp

When needed I retrieve information from various folders (one at a time) and programmically download files using the form from the demo Dart project called "FtpListView" named "Transfer". The downloading works fine but can not get the progress bar to update.

In debugging I see the check below (removed argument list for inserting into this message)

Private Sub Ftp1_Progress() Handles Ftp1.Progress
If Not frmProg Is Nothing Then
...

always is nothing.

The code below is triggered each time a file needs to be downloaded and is called from reading a remote folder listing:

  Private Sub DoRetrieve(ByVal strCountyName As String)
   Ftp1.FileType = FileType.Image
   Try
     Dim frmProg As New frmTransfer(Ftp1, FileName.Name, LocalFilePath() & "\" & FileName.Name, frmTransfer.TransferType.Retrieve)
     frmProg.ShowDialog()
     frmProg = Nothing
   Catch ex As Exception
     Errors.Add("County: " & strCountyName & " Operation:DoRetrieve() Error Message:" & ex.Message)
   End Try
  End Sub

NOTE: I declared Transfer form as shown below:
Private frmProg As frmTransfer


Any thoughts why the transfer form is coming up as nothing? Is there something I am not doing right?


Thanks for your time in reviewing this question,
Kevin



Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted May 23, 2005 11:31 AM

In this case frmProg is a local variable and has no meaning in the Progress event. Instead of dimming a new local one you should be using the form level one (like we do in the sample)
kevininstructor
kevin.s.gallagher@state.or.us

From: Salem, OR USA
Posts: 16
Member Since: 10/12/04
posted May 23, 2005 11:42 AM

Thanks,

Declared form changed to
Dim frmProg As frmTransfer

made change to invokation as shown below
  Private Sub DoRetrieve(ByVal strCountyName As String)
   Ftp1.FileType = FileType.Image
   Try
     frmProg = New frmTransfer(Ftp1, FileName.Name, LocalFilePath() & "\" & FileName.Name, frmTransfer.TransferType.Retrieve)
     frmProg.ShowDialog()
     frmProg = Nothing
   Catch ex As Exception
     Errors.Add("County: " & strCountyName & " Operation:DoRetrieve() Error Message:" & ex.Message)
   End Try
  End Sub



End result...progressbar now works as expected.



Thanks for your input!!!
Kevin
Reply | PowerTCP FTP for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX