Set WodSFTP Event Handlers programmatically in Del - WeOnlyDo Discussion board

Set WodSFTP Event Handlers programmatically in Del (wodSFTP / wodSFTP.NET / wodSFTPdll)

by Ian McGregor, Monday, February 26, 2007, 13:22 (6480 days ago)

I am trying to set the WodSFTP event handlers programmatically, in a unit that does have the object attached to a form.

Thus I have a unit that looks something like

unit untWoD;
interface
implementation
uses wodSFTPCOMLib_TLB, ,,,,,,;
var
WodSFTPComX: TwodSFTPCOM;

procedure MyComConnected(Sender: TObject; ErrorCode: Smallint;
var ErrorText: OleVariant);
begin
CheckErrorCode(ErrorCode, ErrorText)
end;

How do I set the WodSFTPComX.OnConnected event handler to point to my handler MyComConnected ?

I would be grateful if you could send me a short Delphi code stub that shows how to do it. I have got it working on a form with the IDE setting the Event procedures, but I want to create a self-contained unit that is independent of the IDE.


Complete thread: