.Net Assembly Event Handling in Autoit
I wonder if anyone has any guidance on WinSCP session event handling in AutoIT. I am roughly familiar with general COM handling using something like the folloiwng:
$oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc")
Func _ErrFunc($oError)
ConsoleWrite(@ScriptName & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _
@TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number))
EndFunc ;==>_ErrFunc
But I am unsure how to implement a similar handler for the WinSCP.Session events. Would the syntax be something like the following?
$oSession = ObjCreate("WinSCP.Session")
ObjEvent($oSession.Failed, "_WinSCPErrFunc")
Func _WinSCPErrFunc($oError)
ConsoleWrite($oError.ToString() & @crlf)
EndFunc ;==>_WinSCPErrFunc
Does this look correct?
$oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc")
Func _ErrFunc($oError)
ConsoleWrite(@ScriptName & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _
@TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number))
EndFunc ;==>_ErrFunc
But I am unsure how to implement a similar handler for the WinSCP.Session events. Would the syntax be something like the following?
$oSession = ObjCreate("WinSCP.Session")
ObjEvent($oSession.Failed, "_WinSCPErrFunc")
Func _WinSCPErrFunc($oError)
ConsoleWrite($oError.ToString() & @crlf)
EndFunc ;==>_WinSCPErrFunc
Does this look correct?