.Net Assembly Event Handling in Autoit

Advertisement

bobmcrae
Joined:
Posts:
5
Location:
United States

.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?

Reply with quote

Advertisement

You can post new topics in this forum