Reflection FTP API Errors After Upgrading

  • 7022037
  • 20-Jun-2008
  • 02-Mar-2018

Environment

Reflection FTP Client version 15.0 or higher

Situation

If you have an application, script, or macro that uses the API included with Reflection FTP Client version 14.0 or earlier, it may need to be updated to run with version 15.0 or higher.

Note: For a list of products that include Reflection FTP Client, see KB 7021276.

If you have developed a Visual Basic (VB) or .NET C# application to use an earlier version of the Reflection FTP API, you may see errors when attempting to compile or run your application. The error message varies depending on your development environment.

Error when running a C# application:

Retrieving the COM class factory for component with CLSID {21B15F09-4B5F-11D3-A9B6-00C04FA3624C} failed due to the following error: 80040154.

Error when running a Microsoft Visual Basic 6.0 (VB6) application:

ActiveX component can't create object

Error when building a VB6 project:

Compile error: Can't find project or library

Note: These symptoms do not occur with scripts and applications that access the Reflection FTP COM object using version-independent late binding CreateObject() calls and do not reference the type library information (such as constant enum names).

Resolution

To enable your project to run with Reflection FTP Client version 15.0 or higher, make the following changes:

  1. If you are working with a .NET project, remove the existing reference to ReflectionFTP.
  2. In your .NET, VBA, or VB6 project, add a reference to the Reflection FTP 1.15 Type Library.
  3. Modify your code to use ReflectionFTP15 instead of ReflectionFTP3 as shown in the code examples below.
  4. Re-compile your project code.

Code Examples

The following sample code demonstrates using early binding in Visual Basic for Applications (VBA):

Sub Main()
    ' Early binding - using Reflection FTP 1.15 Type Library
    Dim FTP As New ReflectionFTP15
    With FTP
        .Open "host", "username", "password", "", 21, True
        ...
    End With
    Set FTP = Nothing
End Sub

The following sample demonstrates .NET C# code in Microsoft Visual Studio 2005:

using System.Text;
using ReflectionFTP;
namespace ConsoleFTP115Test
{
    class Program
    {
        static void Main(string[] args)
        {
            // Using Reflection FTP 1.15 Type Library
            ReflectionFTP15 FTP = new ReflectionFTP15();
            FTP.Open("host", "username", "password", "", 21, -1);
            ...
        }
    }
}

For complete Reflection FTP API help documentation, see http://support.microfocus.com/manuals/reflection.html?prod=FTP.

Additional Information

Legacy KB ID

This article was originally published as Attachmate technical note 1861.