Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

bobmcrae

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