EldoS | Feel safer!

Software components for data protection, secure storage and transfer

FTP Basic Event Handling with COM

Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.
#14556
Posted: 09/23/2010 09:08:04
by Markdata  (Standard support level)
Joined: 09/23/2010
Posts: 11

Hello!

I have a licenced FTPSBlackBox (and SFTPBlackBox) working on VC++ 6.0

I'm trying to get a list of files using GetFileList and I know that the method OnTextDataLine handles every file.

I have a Sink that listens to the IElSimpleFTPSClientX events.

The question is: How can I identify an event?
I can see that in the Invoke method of my sink events Id's are passed through the "DISPID dispIdMember" parameter right?

I also need to catch the events of the IElSimpleSftpClientX.

Thanks in advance
#14557
Posted: 09/23/2010 09:30:38
by Ken Ivanov (EldoS Corp.)

Thank you for contacting us.

Yes, the events are identified by their DispID's with the use of dispIdMember parameter. Please consider using sample SSH event handler classes included to the distribution as a guide.

The ID values for FTPS and SFTP components' events are as following:
Code
  [
    uuid(850F9C0A-9999-40A4-BCD6-16F23BE0D2D2),
    version(1.0),
    helpstring("Events interface for ElSimpleFTPSClientX Control")
  ]
   dispinterface IElSimpleFTPSClientXEvents
  {
    properties:
    methods:
    [id(0x00000001)]
    HRESULT OnTextDataLine([in] BSTR Text );
    [id(0x00000002)]
    HRESULT OnBinaryData([in] VARIANT Data );
    [id(0x00000003)]
    HRESULT OnProgress([in] long TotalLo, [in] long TotalHi, [in] long CurrentLo, [in] long CurrentHi, [out] VARIANT_BOOL * Cancel );
    [id(0x00000004)]
    HRESULT OnCertificateValidate([in] VARIANT Certificate, [out] VARIANT_BOOL * Validate );
    [id(0x00000005)]
    HRESULT OnCertificateNeededEx([out] VARIANT * Certificate );
    [id(0x00000006)]
    HRESULT OnCiphersNegotiated( void );
    [id(0x00000007)]
    HRESULT OnError([in] long ErrorCode, [in] VARIANT_BOOL Fatal, [in] VARIANT_BOOL Remote );
    [id(0x00000008)]
    HRESULT OnControlSend([in] BSTR Text );
    [id(0x00000009)]
    HRESULT OnControlReceive([in] BSTR Text );
   [id(0x0000000A)]
   HRESULT MessageLoop([out, retval] VARIANT_BOOL * Res);
   [id(0x0000000B)]
   HRESULT OnExtensionsReceived( void );
   [id(0x0000000C)]
   HRESULT OnCertificateStatus([in] TxSBCertificateStatusType StatusType, [in] VARIANT Data);
   [id(0x0000000D)]
   HRESULT OnKeyNeeded([in] BSTR Hint, [out] BSTR * Identity, [out] VARIANT * Key);
   [id(0x0000000E)]
   HRESULT OnInnerClientCreated([in] IElSimpleFTPSClientX7 * Cli);
   [id(0x0000000F)]
   HRESULT OnInnerClientLoggedIn([in] IElSimpleFTPSClientX7 * Cli);
   [id(0x00000010)]
   HRESULT OnInnerClientDestroyed([in] IElSimpleFTPSClientX7 * Cli);
   [id(0x00000011)]
   HRESULT OnFileOperation([in] BSTR RemotePath, [in] BSTR LocalPath, [in, out] VARIANT_BOOL * Skip, [in, out] VARIANT_BOOL * Cancel);
   [id(0x00000012)]
   HRESULT OnFileOperationResult([in] BSTR RemotePath, [in] BSTR LocalPath, [in] long ErrorCode, [in] BSTR Comment, [in, out] VARIANT_BOOL * Cancel);
   [id(0x00000013)]
   HRESULT OnRenegotiationRequest([in] VARIANT_BOOL DataChannel, [in, out] VARIANT_BOOL * Allow);
   [id(0x00000014)]
   HRESULT OnDNSKeyNeeded([in] BSTR Owner, [in] long KeyTag, [in] long Algorithm, [in] IElDNSPublicKeyRecordX * Rec);
   [id(0x00000015)]
   HRESULT OnDNSKeyValidate([in] IElDNSPublicKeyRecordX * Rec, [in, out] VARIANT_BOOL * Valid);
   [id(0x00000016)]
   HRESULT OnDNSResolve([in] BSTR HostName, [in] IUnknown * Response, [in] long ResolveResult, [in] TxSBDNSSecurityStatus SecurityStatus);
  };

  [
    uuid(2B4FB34C-F5A4-41A1-87BD-3E82B7B18E28),
    version(1.0),
    dual,
    oleautomation
  ]
   interface IElSimpleSftpClientXInt: IElSimpleSftpClientX8
   {
   };  
  
  [
    uuid(7767ACAA-E928-4D5F-85C6-06D53B311044),
    version(1.0),
    helpstring("Events interface for ElSimpleSftpClientX Control")
  ]
   dispinterface IElSimpleSFTPClientXEvents
  {
    properties:
    methods:

    [id(0x00000003), helpstring("Is fired when ElSimpleSftpClientX needs to put some encrypted data to transport (e.g. socket)")]
    void OnSend( [in] VARIANT Data );

    [id(0x00000004), helpstring("Is fired when ElSimpleSftpClientX needs some data to be received from transport")]
    void OnReceive( [out] VARIANT * Data, [in] long MaxSize );

    [id(0x00000006), helpstring("Is fired when secure connection is closed")]
    void OnCloseConnection( void );

    [id(0x00000008), helpstring("Is fired when error occurs during transfer")]
    void OnError([in] long ErrorCode );

    [id(0x00000009), helpstring("Is fired when server's public key should be validated")]
    void OnKeyValidate ([in] IElSSHKeyX * ServerKey, [out] VARIANT_BOOL * Valid );

    [id(0x0000000A), helpstring("Is fired when authentication is successfully passed")]
    void OnAuthenticationSuccess( void );

    [id(0x0000000B), helpstring("Is fired when certain authentication type failed")]
    void OnAuthenticationFailed([in] TxSSHAuthenticationType AuthenticationType );

    [id(0x0000000C), helpstring("Is fired when keyboard authentication is requested by server. Echo is an array of boolean. ")]
    void OnAuthenticationKeyboard([in] IElStringListX * Prompts,[in] VARIANT Echo, [in] IElStringListX * Responses);

    [id(0x0000000D), helpstring("Is fired when informational message is received from server")]
    void OnBanner([in] BSTR Text, [in] BSTR Language);

    [id(0x0000000E), helpstring("Gives client application the ability to process messages during long operation")]
    void MessageLoop([out] VARIANT_BOOL * StopAction);
   
   [id(0x00000101)]
   void OnProgress([in] long TotalLo, [in] long TotalHi, [in] long CurrentLo, [in] long CurrentHi, [in, out] VARIANT_BOOL * Cancel);
   [id(0x00000102)]
   void OnFileOperation([in] BSTR RemotePath, [in] BSTR LocalPath, [in, out] VARIANT_BOOL * Skip, [in, out] VARIANT_BOOL * Cancel);
   [id(0x00000103)]
   void OnCiphersNegotiated(void);
   [id(0x00000104)]
   void OnPasswordChangeRequest([in] BSTR Prompt, [in, out] BSTR * NewPassword, [in, out] VARIANT_BOOL * Cancel);
   [id(0x00000105)]
   void OnPrivateKeyNeeded([in] IElSSHKeyX * Key, [in, out] VARIANT_BOOL * Skip);
   [id(0x00000106)]
   void OnAuthenticationStart([in] long SupportedAuths);
   [id(0x00000107)]
   void OnAuthenticationAttempt([in] long AuthType, [in] VARIANT AuthParam);
   [id(0x00000108)]
   void OnVersionSelect([in] TxSBSftpVersions Versions, [in, out] TxSBSftpVersion * Version);
   [id(0x00000109)]
   void OnFileOperationResult([in] BSTR RemotePath, [in] BSTR LocalPath, [in] long ErrorCode, [in] BSTR Comment, [in, out] VARIANT_BOOL * Cancel);
   [id(0x0000010A)]
   void OnDNSKeyNeeded([in] BSTR Owner, [in] long KeyTag, [in] long Algorithm, [in] IElDNSPublicKeyRecordX * Rec);
   [id(0x0000010B)]
   void OnDNSKeyValidate([in] IElDNSPublicKeyRecordX * Rec, [in, out] VARIANT_BOOL * Valid);
   [id(0x0000010C)]
   void OnDNSResolve([in] BSTR HostName, [in] IUnknown * Response, [in] long ResolveResult, [in] TxSBDNSSecurityStatus SecurityStatus);
  };
#14558
Posted: 09/23/2010 09:50:10
by Markdata  (Standard support level)
Joined: 09/23/2010
Posts: 11

Thanks a lot!!

Indeed I'm using the sample as a guide to my implementation.

Thanks again for the quick reply Innokentiy. :)

Cheers
Regi

Reply

Statistics

Topic viewed 806 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!