SmartFTP FTP Library
_IFTPConnectionEvents Interface
dispinterface _IFTPConnectionEvents;

Event dispatch interface for the IFTPConnection interface. 


Technical Details 

All events are synchronous. Depending on the class providing the _IFTPConnectionEvents interface, events are fired from different threads. The FTPConnectionSTA fires all events from the main thread, the FTPConnectionMTA class fires the events from the worker thread. 



#import "libid:7A3A786C-EB8C-43b3-BC10-8D09ACF5D195"
// Note: Uncomment for Microsoft Visual Studio 6.0
//#import "C:\Program Files\SmartFTP FTP Library\sfFTPLib.dll"

CComPtr<IFTPConnection> pConnection;
    // How to Advise
    DWORD dwCookie = 0xEFEFEFEF;
    AtlAdvise(pConnection, m_pEventSink, __uuidof(sfFTPLib::_IFTPConnectionEvents), &dwCookie);

    // How to Unadvise
    if(m_dwCookie != 0xFEFEFEFE)
        AtlUnadvise(pConnection, __uuidof(sfFTPLib::_IFTPConnectionEvents), dwCookie);



Dim WithEvents objFTP As FTPConnectionSTA
Set objFTP = New FTPConnectionSTA

Private Sub objFTP_OnTransferProgress(ByVal nBytesTransferredLo As Long, ByVal nBytesTransferredHi As Long)
'Label1.Caption = nBytesTransferredLo
End Sub
_IFTPConnectionEvents Methods 
The event is fired after the Disconnect method completed.
See OnSocketDisconnect as well. 
The event is fired after the login succeeded. 
The event is fired when the socket is disconnected/closed. The event is triggered when the winsock notify FD_CLOSE is received.
See also OnDisconnect 
The event is fired when the client sends a command, receives a server response or for internal messages.

If the type t equals ftpStatusEventTypeLocalHelp the strText contains the following values:  
The event is fired after a transfer (list, upload, download, fxp) completed. 
The event is fired during data transfers.
Data transfers include directory listings, uploads and downloads. The event is fired every 500 ms. 
The event is fired after a transfer (list, upload, download, fxp) started. 
Called during the SSL/TLS handshake. Client can verify the server certificate and set the bContinue value accordingly. 
What do you think about this topic? Send feedback!
Copyright (c) by SmartSoft Ltd. All rights reserved.