Creating an OLE Script

HostExplorer Programming

Creating an OLE Script

You can code OLE Automation containers to implement all the features and functions of FTP in another application that uses OLE features, such as Hummingbird Basic. You can work with FTP session objects to call functions, such as connecting to a host, transferring files from host to host, and so on. You can use any tool that supports OLE Automation control, such as Visual C++ and Visual Basic.

To create an OLE script:

  1. Create the main FTP Engine Object. All objects support a dual interface. This lets you fully use the FTP OLE features. For example:

Dim FtpEngine As Object
Set FtpEngine = CreateObject("HclFtp.Engine")
  1. Retrieve an FTP Sessions collection. This lets you set such things as local drives, access permissions, and so on. For example:

Dim FtpSessions As Object
Set FtpSessions = FtpEngine.Sessions
  1. Create the FTP Session object. For example:

Dim FtpSession1 As Object
Set FtpSession1 = FtpSessions.NewSession
  1. Set properties, such as server name, user name, user account, and so on. For example:

FtpSession1.ServerName=ftp.com
  1. Call session methods, such as Connect to Host, User Login, Get, and so on. For example:

FtpSession1.UserLogin

Related Topics

Introducing FTP OLE API

Sample Client Source Code