Gambit
I'm having some wierd issues with handlers working in vb.net 2005.
Not sure if I'm missing something here but I'm basing this off the sample and porting it over to use a form instead of command.
I start off using
[codebox]Public Class Form1
Public objFTP As FTPConnectionMTA
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim objGlobal As sfFTPLib.[Global]
'objGlobal = CreateObject("sfFTPLib.Global")
objGlobal = New sfFTPLib.[Global]
objFTP = New sfFTPLib.FTPConnectionMTA
...licnence info here...
' Attach the event handler
AddHandler objFTP.OnConnect, AddressOf _OnConnect
AddHandler objFTP.OnChangeDirectory, AddressOf _OnChangeDirectory
AddHandler objFTP.OnTransferProgress, AddressOf _OnTransferProgress
[/codebox]
for the handlers I do
[codebox] Private Sub _OnChangeDirectory(ByVal szDirectory As String)
TextBox2.Text = TextBox2.Text & "OnChangeDirectory(" & szDirectory & ")"
End Sub
Private Sub _OnTransferProgress(ByVal nBytesTransferredLo As Integer, ByVal nBytesTransferredHi As Integer)
TextBox2.Text = TextBox2.Text & "OnTransferProgress(" & objFTP.LastTransferBytes & ")"
End Sub
Private Sub _OnConnect()
TextBox2.Text = TextBox2.Text & "Connected"
End Sub[/codebox]
For some reason as soon as it tryed to write to TextBox2 or any other UI element it hangs.
I'm I missing something here?
Thanks
Not sure if I'm missing something here but I'm basing this off the sample and porting it over to use a form instead of command.
I start off using
[codebox]Public Class Form1
Public objFTP As FTPConnectionMTA
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim objGlobal As sfFTPLib.[Global]
'objGlobal = CreateObject("sfFTPLib.Global")
objGlobal = New sfFTPLib.[Global]
objFTP = New sfFTPLib.FTPConnectionMTA
...licnence info here...
' Attach the event handler
AddHandler objFTP.OnConnect, AddressOf _OnConnect
AddHandler objFTP.OnChangeDirectory, AddressOf _OnChangeDirectory
AddHandler objFTP.OnTransferProgress, AddressOf _OnTransferProgress
[/codebox]
for the handlers I do
[codebox] Private Sub _OnChangeDirectory(ByVal szDirectory As String)
TextBox2.Text = TextBox2.Text & "OnChangeDirectory(" & szDirectory & ")"
End Sub
Private Sub _OnTransferProgress(ByVal nBytesTransferredLo As Integer, ByVal nBytesTransferredHi As Integer)
TextBox2.Text = TextBox2.Text & "OnTransferProgress(" & objFTP.LastTransferBytes & ")"
End Sub
Private Sub _OnConnect()
TextBox2.Text = TextBox2.Text & "Connected"
End Sub[/codebox]
For some reason as soon as it tryed to write to TextBox2 or any other UI element it hangs.
I'm I missing something here?
Thanks