MarshallSoft

FTP Client Engine

Library for C/C++


Programmer's Manual


(FCE4C)


Version 2.6

January 17, 2007



This software is provided as-is.
There are no warranties, expressed or implied.



Copyright (C) 2007
All rights reserved



MarshallSoft Computing, Inc.
Post Office Box 4543
Huntsville AL 35815


Voice : 1.256.881.4630

FAX : 1.256.880.0925

email : info@marshallsoft.com

web : www.marshallsoft.com


MARSHALLSOFT is a registered trademark of MarshallSoft Computing.



TABLE OF CONTENTS


1 Introduction
1.1 Features
1.2 Documentation Set
1.3 Example Program
1.4 Installation
1.5 Uninstalling
1.6 Pricing
1.7 Updates
1.8 Keycode (License Key)
2 Library Overview
2.1 Dynamic Link Libraries
2.2 Console Mode
2.3 Using the Library
2.4 Static Linking
2.5 Win32 STDCALL and DECLSPEC
2.6 Calling FCE from C++
2.7 Adding FCE To Your Existing Program
3 Compiler Issues
3.1 Compiling Using an IDE
3.2 Command Line Tool Setup
3.3 Command Line Batch Files
3.4 Command Line Makefiles
4 Supported Compilers
4.1 Microsoft Visual C/C++
4.2 Microsoft C/C++ .NET
4.3 Microsoft C#
4.4 Borland C/C++
4.5 Turbo C/C++ for Windows
4.6 Borland C++ Builder
4.7 Watcom C/C++
4.8 Lcc-Win32 C
5 Example Programs
5.1 FCEVER
5.2 GET
5.3 WINFTP
5.4 CONFTP
5.5 BCB
5.6 MFC
5.7 MULTI
5.8 CONN
5.9 MGET
5.10 MPUT
5.11 PROXY
5.12 SPEED
5.13 HELLO
5.14 VC_VER
5.15 CS_VER
5.16 VC_GET
5.17 CS_GET
6 Revision History

1 Introduction

The FTP Client Engine for C/C++ (FCE4C) is a component library of functions providing direct control of the FTP protocol from a C/C++ application. The FCE component library can be used for both anonymous and private FTP sessions.

A simple interface allows connecting to any FTP server, navigating its directory structure, listing files, sending files, deleting files, and receiving files using the FTP protocol.

FCE4C includes multiple C/C++ example programs demonstrating FTP processing. Microsoft Foundation Class (MFC), Borland C++ Builder (BCB) and Visual C# .NET examples are also provided.

The FTP Client Engine for C/C++ component library supports and has been tested with C/C++, Microsoft Visual C++, Visual C++ .NET, Visual C# .NET, Borland C/C++, Borland Turbo C++ for Windows, Borland C++ Builder, Watcom C/C++, and LCC-Win32 C compilers. FCE4C can also be used with most other C/C++ Windows compilers.

Both Win16 and Win32 DLLs (Dynamic Link Libraries) are provided. FCE4C runs under all versions of Windows (Windows 95, Windows 98, Windows ME, Windows 2000, Windows NT and Windows XP). The FTP Client Engine SDK DLLs (FCE16.DLL and FCE32.DLL) can also be used from any language (Visual Basic, VB.NET, ACCESS, EXCEL, VBA, Borland Delphi, Visual FoxPro, COBOL, Xbase++, Visual dBase, etc.) capable of calling the Windows API.

When comparing the FTP Client Engine against our competition, note that:

  1. FCE4C is a standard Windows DLL (NOT an OCX or ActiveX control) and is much smaller than a comparable OCX or ActiveX control.
  2. Both WIN16 and WIN32 DLLs are included.
  3. FCE4C does NOT depend on ActiveX or Microsoft Foundation Class (MFC) libraries or similar "support" libraries.
  4. The WIN32 version of FCE is fully threadable.
  5. The FCE functions can be called from applications not capable of using controls.

MarshallSoft also has versions of the FTP Client Engine Library for Visual Basic (FCE4VB), Delphi (FCE4D), PowerBASIC (FCE4PB), Visual FoxPro (FCE4FP), Visual dBASE (FCE4DB), and Xbase++ (FCE4XB). All versions of FCE use the same DLLs (FCE16.DLL or FCE32.DLL). However, the examples provided for each version are written for the specified computer language.

All versions of the FTP Client Engine Library (FCE) can be downloaded from our web site at http://www.marshallsoft.com/ftp-client-library.htm

1.1 Features

Some of the many features of the FTP Client Engine component library are as follows:

  1. Connect to any (anonymous or private) FTP server.
  2. Get a list of files (names or long format) on the server.
  3. Navigate the server directories.
  4. Specify ASCII or BINARY transfer mode.
  5. Download files (with wildcard support).
  6. Upload files (with wildcard support).
  7. Delete files.
  8. Rename files.
  9. Create and remove server directories.
  10. Support for PROXY servers.
  11. Supports passive mode (use with firewalls).
  12. Supports multiple concurrent FTP sessions.
  13. Resume file transfers from any offset.
  14. Change files names while being uploaded or downloaded.
  15. Can parse long directory listings.
  16. Can specify the FTP or data port.
  17. Can set minimum and maximum response waits.
  18. Supports file appending.
  19. Supports S/KEY password encryption.
  20. Use on Internet or your own intranet (LAN).
  21. Royalty free distribution with your compiled application.
  22. Can be purchased with or without source code
  23. Updates are free for one year (Updates to source code are separate).
  24. Evaluation version is fully functional.

1.2 Documentation Set

The complete set of documentation consists of four manuals in three formats. This is the first manual (FCE_4C) in the set.

Each manual comes in three formats:

The FCE_4C Programmer's Manual is the language specific (C/C++) manual dealing with compiler and programming issues such as installation and example programs. Read this manual first.

The FCE User's Manual (FCE_USR) discusses FTP in general as well as language independent programming issues such as application notes and includes purchasing and license information. Read this manual second.

The FCE Reference Manual (FCE_REF) contains details on each individual FCE function.

Use Microsoft Word or Microsoft WordPad to print the document files. All manuals can also be viewed online at

http://www.marshallsoft.com/fce4c.htm

1.3 Example Program

The following example demonstrates the use of some of the FTP Client Engine library functions:

     #include <windows.h>
     #include <stdio.h>
     #include "fce.h"
   
     void main(int argc, char *argv)
     {int Code;
      /* attach FCE */
      Code = fceAttach(1, 0); // KEY_CODE = 0
      if(Code<0) ErrorExit(Code);
      /* connect to server */
      Code = fceConnect(0,(LPSTR)"ftp.marshallsoft.com",
                   (LPSTR)"anonymous", (LPSTR)"msc@traveller.com");
      if(Code<0) ErrorExit(Code);
      /* change to proper directory */
      Code = fceSetServerDir(0, (LPSTR)"pub/oem");
      if(Code<0) ErrorExit(Code);
      /* set to ASCII xfer mode */
      fceSetMode(0,'A');
      /* download the file */
      Code = fceGetFile(0,(LPSTR)"fce-new.txt");
      if(Code<0) ErrorExit(Code);
      /* QUIT */
      fceClose(0);
      fceRelease();
     }

In the example program above, fceConnect is called to connect to the FTP server as user "anonymous" and password "msc@traveller.com".

The server directory is changed to "pub/oem", the transfer mode is set to ASCII, and the file "fce-new.txt" is downloaded. Lastly, the connection to the FTP server is closed and FCE is released.

Refer to the FCE Reference Manual (FCE_REF) for individual function details. Access online at http://www.marshallsoft.com/fce_ref.htm


1.4 Installation

  1. Before installation of FCE4C, your Windows C/C++ compiler should already be installed on your system and tested. In particular, include command line tools when installing your compiler if you want to compile using command line makefiles. If you need help with makefiles, see MAKEFILE.TXT.

  2. Unzip FCE4C26.ZIP (demo version) or FCExxxx.ZIP (registered version; xxxx is the Customer ID).

  3. Run the installation program SETUP.EXE which will install all FCE4C files, including copying FCE16.DLL and FCE32.DLL to your Windows directory. No Windows system files are modified.

All recent WIN32 C/C++ compilers support the "declspec" keyword. Microsoft VC (version 4.0 and up), Borland (version 5.0 and up), Watcom (version 11.0 and up), and Lcc-Win32 compilers support the "declspec" keyword. If you have an older Win32 compiler, you can get the legacy DLLs from our web site at

     http://www.marshallsoft.com/fce4c.htm

1.5 Uninstalling

Uninstalling FCE4C is very easy. FCE does NOT modify the registry. First, delete the FCE project directory created when installing FCE4C. Second, delete FCE16.DLL and FCE32.DLL from your Windows directory, typically C:\WINDOWS for Windows /95/98/Me/XP or C:\WINNT for Windows NT/2000. That's it!

1.6 Pricing

A developer's license for FCE4C can be registered for $115 ($295 with ANSI C source code to the DLLs). Purchasing details can be found in Section_1.3, "How to Purchase", of the FCE User's Manual (FCE_USR). (http://www.marshallsoft.com/fce_usr.htm#Section_1.3)

1.7 Updates

When you register FCE4C you will receive a set of registered DLLs plus a license file (FCExxxx.LIC) that can be used to update your registered DLL's for a period of one year from purchase. Updates can be downloaded from

      http://www.marshallsoft.com/oem.htm

After one year, your license must be updated if you want to be able to download updates. Your license can be updated for $30 if ordered within one year of the original purchase (or previous update). After one year, licenses can be updated for $55. Also see file UPDATES.TXT.

1.8 Keycode (License Key)

FCE16.DLL and FCE32.DLL each have a keycode encoded within them. Your keycode is a 9 or 10 digit decimal number (unless it is 0), and will be found in the file KEYCODE.H. The keycode for the evaluation version is 0. You will receive a new key code when registering. The KEYCODE is passed to fceAttach.

If you get an error message (value -74) when calling fceAttach, it means that the keycode in your application does not match the keycode in the DLL. After registering, it is best to remove the evaluation version of the FCE DLL's from the Windows search.


2 Library Overview

2.1 Dynamic Link Libraries

The FTP Client Engine library is implemented as a dynamic link library (DLL). Both Win16 and Win32 DLLs are included. A DLL is characterized by the fact that it need not be loaded until required by an application program and that only one copy of the DLL is necessary regardless of the number of application programs that use it. Contrast this to the traditional static library that is bound to each and every application that uses it at link time.

An important advantage that DLL's have over other "popular" library formats such as VBX or OCX is that DLL's are callable by all Windows applications. Since DLL's are the building blocks of the Windows Operating System, they will not be replaced by a "newer technology".

2.2 Console Mode

Our library functions can be called from Win32 console mode programs. A "console mode" program is a Windows 95/98/NT/2000/Me/XP WIN32 command line program running in a command window. Although console mode programs look like DOS programs, they are WIN32 programs that have access to the Win32 API and the entire Windows address space. Programming using console mode programs reduces the complexity of using GUI code. All console mode programs can be converted to GUI mode by adding the necessary Windows interface code

2.3 Using the Library

Our library has been tested on multiple computers running Windows 95/98/Me/NT/2000/XP.

The library has also been tested with several C/C++ compilers, including Microsoft Visual C++ (all versions including C++ .NET and C# .NET), Borland C/C++, Borland C++ Builder, Turbo C/C++ for Windows, and Watcom C/C++.

2.4 Static Linking

Static libraries require the object file version (FCE32.OBJ) of the DLL (included in the registered package) or source code. To create an application that links FCE16.OBJ or FCE32.OBJ statically:

  1. All application code that includes FCE.H must define STATIC_LIBRARY before including FCE.H
  2. Your application must link with WINSOCK.DLL (for WIN16) or with WSOCK32 (for WIN32).

If using Microsoft Developer Studio, make these changes:

  1. To your project file: Do NOT add FCE 32.LIB to your project file.
  2. To the settings: (See "Build Settings" or "Project/Settings") (2a) C/C++ Tab: Add STATIC_LIBRARY to "preprocessor definitions:". (2b) Link Tab: Add WSOCK32.LIB and FCE32.OBJ to "object/library modules:".
  3. Add #include "FCE.H" to all source files that make calls to FCE functions.


2.5 Win32 STDCALL and DECLSPEC

Our 32-bit libraries are compiled using the _stdcall and _declspec keywords. This means that they use the same calling conventions and file naming conventions as the Win32 API. In particular, function names are NOT decorated. There are no leading underscores or trailing "@size" strings added to function names.

Microsoft Visual C/C++ users can look at the DLL function names using the dumpbin.exe executable:

dumpbin /exports fce32.dll

2.6 Calling DLL Functions from C++

Like Windows itself, FCE functions are coded in ANSI C, but they can be called directly from both ANSI C programs and from C++ programs.

FCE functions can also be called using the C++ class wrapper ffce. Refer to ffce.cpp and ffce.h as well as the HELLO.CPP program for an example.

2.7 Adding DLL Functions To Your Existing Program

In order to call DLL functions from your existing program,

  1. Add
#include "fce.h"

to your source code,

  1. Link with FCE32.LIB (for MSVC), FCE32BCB.LIB (Borland C/C++ and C++ Builder), FCE32.LIB (Watcom), or FCE32LCC (Win32/LCC)

and recompile from source.

Also refer to Section 4.0 below.


3.0 Compiler Issues

Application programs can be compiled using an IDE or command line compiler tools. The following sections provide general compiler information.

3.1 Compiling Using an IDE

All current windows compilers have an "Integrated Development Environment" (IDE) for building application programs in the Windows environment.

Note that not only do IDE's vary between the different compiler manufacturers, but they also vary from version to version for the same compiler.

3.1.1 Compiling Example Programs with an IDE

Most of the example programs can be compiled from your compiler's IDE. For Visual C++, "project makefiles" are used since they can be used by all versions of Visual C++ (v4.0, v5.0, and v6.0). When opening the workspace, select "makefiles(.mak)" for the file type.

Alternatively, for VC++ v6.0, select "projects (.dsp)" for the file type.

3.1.2 Compiling New Projects with an IDE

All of the IDE's use the concept of a file hierarchy. For example, the FCEVER example program file hierarchy in the IDE (for 32-bit) should look like:

       FCEVER.EXE
          +++ FCEVER.C
          +++ FCE32.LIB
   
Replace FCE32.LIB with FCE32BCB.LIB if using Borland C++ Builder, and with FCE32LCC.LIB if using LCC-Win32.

The order of the files is not significant. Refer to Section 4 below for a particular IDE.

3.2 Command Line Tool Setup

Many software developers overlook the power of using command line compilers. There are a number of very significant advantages to using the command line version of your C/C++ compiler. Among these are:

If you want to compile from the command line, your command line compiler tools must be set up properly. Note that you have an option of installing the command line tools (or not) when your compiler is first installed. Refer to your compiler manufacturer's manual for details.

If necessary, you can increase the size of your environment table space by adding

SHELL=C:\COMMAND.COM /e:1024 /p

to CONFIG.SYS in C:\ and then rebooting. Yes, this works for all versions of Windows, including Windows NT, 2000, and XP

For all compilers, your path should point to the compiler's BIN directory. For example, to add "C:\BC50\BIN" to your existing path, use

PATH C:\BC50\BIN;%PATH%

3.2.1 Microsoft

Set LIB and INCLUDE environment variables. For example,

SET INCLUDE=C:\MSVC\INCLUDE
SET LIB=C:\MSVC\LIB

3.2.2 Borland

Check that TURBOC.CFG, BCC32.CFG, TLINK.CFG, and TLINK32.CFG all have the correct information in them, as they should have when your compiler was installed. For example,

-IC:\BC5\INCLUDE
-LC:\BC5\LIB

BRCC (the Borland Resource Compiler) doesn't use the *.CFG files. Set the INCLUDE environment variable or BRCC will not be able to find the INCLUDE files (such as WINDOWS.H). For example,

SET INCLUDE=C:\BC5\INCLUDE

Clear the LIB environment variable (so it is not present when SET is typed at the command line) with

SET LIB=


3.2.3 Watcom

Set the WATCOM environment variables to point to your compilers include (H) and BIN directories. For example,

SET INCLUDE=C:\WC11\H;C:\WC11\H\NT
SET WATCOM=C:\WC11
SET EDPATH=C:\WC11\EDDAT
SET WWINHELP=E:\BINW

3.2.4 LCC-Win32

The LCC environment variables are set like the others. For example,

SET INCLUDE=C:\LCC\INCLUDE
SET LIB=C:\LCC\LIB

After making the above changes for your compiler, type PATH at the command line prompt to verify the search path, and type SET at the command line prompt to verify the INCLUDE and LIB environment variables.

3.3 Command Line Batch Files

If your compiler installation includes command line tools, then all of the example programs can be compiled directly from the command line. These same compiler commands can also be placed in a batch file.

3.4 Command Line Makefiles

Command line makefiles originated on UNIX systems. They are the standard way that C/C++ programs are constructed in command line environments. The advantage of makefiles (as compared to an integrated development environment) is that all compiler switches are always coded within the makefile and the makefile can be run with a single keystroke.

Command line makefiles are provided for Microsoft, Borland, Watcom, and LCC-Win32 command line compilers. They can be found in the APPS sub-directory:

     borland50.zip     Borland C/C++ 5.0 makefiles.
     borland55.zip     Borland C/C++ 5.5 makefiles.
     c-builder.zip     Borland C++ Builder project makefiles.
     lcc-win32.zip     LCC-WIN32 project command files.
     microsoft60.zip   Microsoft C/C++ (v1.52, v4.0, v5.0, v6.0) makefiles.
     watcom11.zip      Watcom C/C++ 11 makefiles.

4.0 Supported Compilers

Our libraries have been tested with Microsoft Visual C/C++ (all versions including Visual C++ .Net and C# .NET), Borland C/C++, Borland C++ Builder, Borland Turbo C/C++, Watcom C/C++, and Lcc-Win32. Other Windows C/C++ compilers may work as well. Refer also to Section 5, "Compiling Example Programs".

4.1 Microsoft Visual C++ (all versions)

Microsoft Visual C/C++ programs can be compiled from either the command line or from within the Microsoft Visual Studio development environment. All MSVC programs are Win32 only.

4.1.1 Microsoft Command Line Makefiles

Programs can be compiled using command line makefiles. All Microsoft Win32 command line makefiles end with '"_m_". To compile using a makefile, use the Microsoft NMAKE utility. For example,

NMAKE -f FCEVER._M_

FCE can be used with Microsoft Foundation Class (MFC) programs.

The file MICROSOFT60.ZIP contains the Microsoft C/C++ (v4.0, v5.0, v6.0) command line makefiles.

4.1.2 Microsoft Developer Studio (VC v4.0)

To open an existing project, choose "File", then "Open Workspace", and then select "makefiles" from the list of file types. Most of the example programs have Microsoft Developer C/C++ project makefiles, ending with ".MAK" , such as FCEVER.MAK

To create a new project in MSVC v4.0, choose "File", then "New", then "Project Workspace". Select "Application" or "Console Application" for "Type:" and your project name for "Name:". Choose Win32 for platform. Then select "Create". Select "Insert", then "Files into Project". Add all filenames including any resource file (.RC) and FCE32.LIB. Lastly, select "Build", then "Rebuild All". Be sure to specify /YX rather than /Yu in your project settings [Build, Settings..., C/C++].

4.1.3 Microsoft Visual Studio (VC v5.0)

To open an existing project, choose "File", then "Open Workspace", and then select "makefiles" from the list of file types. Most of the example programs have Microsoft Developer C/C++ project makefiles, ending with ".MAK" , such as FCEVER.MAK.

To create a new project in MSVC v5.0, choose "File", then "New", then "Win32 Application" or "Win32 Console Application " and your project name. Check "Create new workspace". Select "Project", then "Add to Project". Add all filenames including any resource file (.RC) and FCE32.LIB. Lastly, select "Rebuild All".

If the compiler complains that it cannot find "_main", "Console Application" was chosen but the program being compiled is a GUI application. If the compiler complains that it cannot find "WinMain", "Application" was chosen but the program being compiled is a Console Mode application. Be sure to specify /YX rather than /Yu in your project settings [Build, Settings..., C/C++].

4.1.4 Microsoft Visual Studio (VC v6.0)

To open an existing project, follow the same directions as for MSVC v5.0, except that a DSP project file may be used instead of the MAK project makefile.

To create a new project in MSVC v6.0, follow the same directions as for MSVC v5.0 above.


4.2 Microsoft Visual C++ .NET

All Visual Studio VC.Net projects end with extension ".vcproj". For example,

vc_vers.vcproj

In order to open an existing Visual C++ .Net project, choose "File", "Open", and then "Project" from the Visual Studio menu. Specify the directory containing the Visual C++ .Net project files (for example, C:\FCE4C\APPS).

In order to call FCE functions from Visual C++ .Net programs, do the following to your existing Visual C++ .Net project:

  1. Add
#include "fce.h"
#include "keycode.h"

after your existing #include statements.

  1. Open the project properties window under "Project" on the main menu. If your project is named "MyProject", then select "MyProject properties".

  2. Select "Configuration Properties", "Linker", "Input", "Additional Dependencies", and then type in "FCE32.LIB" into the edit box. Note that FCE32.LIB must be in your project directory along with all of your source files.

  3. Rebuild.

NOTE: If using pre-compiled headers, the include statement

#include "stdafx.h"

must be the first include statement in your program.

4.3 Microsoft Visual C#

FCE functions can be called from C# (C-sharp) in the same manner as Win32 API functions.

All C# projects end with extension ".csproj". For example,

cs_vers.csproj

In order to open an existing C# project, choose "File", "Open", and then "Project" from the Microsoft Development Environment.. Specify the directory containing the C# project files (for example, C:\FCE4C\APPS).

In order to call FCE functions from your C# programs, do the following to your existing C# source code:

Add the contents of file fce_funs.cs to source code after

public class fce : System.Windows.Forms.Form

Add the constants from fce_sons.cs to your program as they are needed.

Look at the cs_vers program in the APPS directory for an example.

4.4 Borland C/C++

Borland C/C++ version 5.0 programs can be compiled from either the command line (using makefiles ending with "._b_") or from within the Borland development environment using Borland v5.0 or above.

Borland C/C++ Version 5.5 (which can be downloaded from www.borland.com) is a free Win32 console mode compiler (no IDE). Makefiles for BC v5.5 end with "._i_", and (like Borland C++ Builder) use ILINK32 rather than TLINK32. Be careful with linker response files (*.RSP) -- they must NOT end with a carriage return / line feed!

Borland programs always link with FCE32BCB.LIB.

4.4.1 Borland Command Line Makefiles

Programs can be compiled using command line makefiles. All Borland Win32 command line makefiles end with "._b_" (or "._i_" for Borland_5.5). To compile using a makefile, use the Borland MAKE utility. For example,

MAKE -f FCEVER._B_

The file, BORLAND50.ZIP, contains the Borland C/C++ 5.0 command line makefiles, and
the file, BORLAND55.ZIP, contains the Borland C/C++ 5.5 command line makefiles.

4.4.2 Borland IDE

To create a new project, first turn off LINKER case sensitivities: Choose "Options", "Projects", "Linker", "General". Turn off the "case sensitive link" and "case sensitive exports and imports" boxes.

Next, choose "Files", then "New Project". Use the INS (Insert) key to pop up a dialog box into which the project file names are entered. Lastly, add FCE32BCB.LIB to your project. FCE32BCB.LIB can also be created from FCE32.DLL using the Borland IMPLIB utility:

IMPLIB FCE32BCB.LIB FCE32.DLL

Select "GUI" or "Console" for the "Target Model:". Only "Static" or "Dynamic" should be checked for "Standard Libraries:"

NOTE1: If, after linking in the IDE, you get unresolved external references to the library functions in which each function name is all upper case, then you have NOT turned off case sensitivity as described above.

NOTE2: If you get errors compiling the windows header file "WINDOWS.H", turn on "Borland Extensions" in "Options", "Project", "Compiler", "Source".

4.5 Borland Turbo C/C++ for Windows

Borland Turbo C/C++ for Windows does not have command line tools, so all programs must be compiled from the Turbo C/C++ integrated environment.

Follow the same directions as above (Borland IDE), except that the "Target Model:" can be any listed.

4.6 Borland C++ Builder

Borland C++ Builder does not have command line tools, so all programs must be compiled from the Borland C++ Builder integrated environment. Compile the BCB example program BCB_PRJ with BCB_PRJ.MAK if running BCB version 1 through 3, and compile with BCB_PRJ.BPR if running BCB version 4 or above.

To load the BCB_PRJ example project, Choose "File" / "Open Project" on the menu bar. Load BCB_PRJ.MAK (or BCB_PRJ.BPR). Then, choose "Build All" from "Project" to create the executable.

Note that FCE32BCB.LIB is the LIB file used with Borland C++ Builder. FCE32BCB .LIB can be created from FCE32.DLL by using the Borland IMPLIB program:

IMPLIB FCE32BCB.LIB FCE32.DLL

The file C-BUILDER.ZIP contains the Borland C++ Builder project makefiles.

4.7 Watcom C/C++

Watcom C/C++ programs can be compiled from either the command line or from within the Watcom development environment.

4.7.1 Watcom Command Line Makefiles

Win32 programs can be compiled using command line makefiles. All Watcom command line makefiles end with "._w_" for Win32 makefiles. To compile using a makefile, use the Watcom WMAKE utility. For example,

WMAKE -f FCEVER._W_

Win32 programs can also be compiled using command line batch files. See FCEVER$.BAT for an example of a console mode command line batch file and FCEVER$.BAT for an example of a GUI mode command line batch file. To run these command line batch files from the command line, type

FCEVER

The file, WATCOM11.ZIP, contains the Watcom C/C++ 11 command line makefiles.

4.7.2 Watcom IDE

To create a new project, choose "File", then "New Project". Enter the project name and then choose Win32 as the target. Use the INS (Insert) key to pop up a dialog box into which the project file names are entered.

Select "Options" from the main window, then "C Compiler Switches", then "10". Memory Models and Processor Switches". Check "80386 Stack based calling [-3s]", then check "32-bit Flat model [-mf]".

4.8 LCC-Win32 C/C++

Lcc-Win32 C/C++ programs can be compiled from either the command line or from within the development environment.

Lcc-Win32 is a freeware C compiler developed and distributed by Jacob Navia at

http://www.cs.virginia.edu/~lcc-win32/

To use our DLL's with Lcc-Win32, you must link with FCE32LCC.LIB. This file can also be re-created using the Lcc-Win32 utility BUILDLIB.

buildlib fce32.lcc fce32lcc.lib

Then, compile and link as normal. For example, to compile the FCEVER example program,

lcc -DWIN32 fcever.c
lcclnk fcever.obj fce32.lib -subsystem:console

To compile the GUI mode example VERS,

lcc -DWIN32 vers.c
lcc -DWIN32 paint.c
lrc vers.rc
lcclnk vers.obj paint.obj fce32lcc.lib vers.res -subsystem:windows

Command files are used for Lcc-Win32 rather than makefiles since the make utility that comes with LCC-Win32 does not work well (unlike the actual compiler).

The file, lcc-win32.zip, contains the LCC-WIN32 project command files.


5 Example Programs

Some of the example program are written in GUI mode (WINFTP, VC_GET, BCB_PRJ), although most are written in Win32 console mode. Note that console mode programs must be run from the Windows command prompt. Also note that console mode programs can be converted to GUI mode by adding the necessary Windows interface code.

Makefiles are classified as follows:

Files ending with .MAK (and .BPR) include:

5.1 FCEVER

The first example program is the console mode program FCEVER (FCE Version) that displays the FCE library version number and registration string.

There are command line makefiles for Microsoft (FCEVER32._M_), Borland (FCEVER32._B_), and Watcom (FCEVER32._W_), as well as a Microsoft Developer Studio makefile (FCEVER32.MAK).

After compiling, from the command line, type:

     FCEVER

5.2 GET

GET is a console mode Win32 FTP client application that connects to our FTP server anonymously and downloads the file "fce-new.txt". After compiling, from the command line, type:

     GET


5.3 WINFTP

WINFTP is a Win16/Win32 GUI (Graphical User Interface) application that can be used to connect to a FTP server and upload, download, and delete files. See WINFTP.TXT in the DOCS directory for more details.

There are command line makefiles for Microsoft (WINFTP16._M_ and WINFTP32._M_), Borland (WINFTP16._B_ and WINFTP32._B_), and Watcom (WINFTP32._W_), Microsoft Developer Studio makefile (WINFTP32.MAK). There is also an Lcc-Win32 compiler batch file (WINFTP$.BAT).

5.4 CONFTP

CONFTP is a generic FTP client (console mode) application that exercises most of the FCE functions. After compiling, start CONFTP from the command line

     CONFTP server user password

5.5 BCB_PRJ

BCB_PRJ is a Borland C++ Builder (BCB) example program similar to WINFTP.

For Borland C++ Builder version 1 through 3, use project file BCB_PRJ.MAK. For Borland C++ Builder version 4 and above, use project file BCB_PRJ.BPR.

BCB programs must always link with FCE32BCB.LIB rather than with FCE32.LIB.

5.6 MFC_PGM

MFC_PGM is a Microsoft Foundation Class equivalent of the GETPRO example program. Its purpose is to demonstrate calling FCE functions from MFC. Compile from the command line with MFCPGM16.MAK and MFCPGM32.MAK.

5.7 MULTI

MULTI is a Win32 console mode application that uses multiple threads in order to log on to several FTP servers concurrently.

Be sure to edit the FTP account information in MULTI.C before compiling.

5.8 CONN

CONN is a console mode program used to test connection timeouts. For example, to connect to server "ftp.hiwaay.com" as user "anonymous" with password "you@yourisp.net" waiting for a maximum of 5 seconds for the connection to complete, type (at the command line):

     CONN ftp.hiwaay.net anonymous you@yourisp.net 5

5.9 MGET

MGET is a console mode program that downloads all files (from the server directory) that match a user specified file specification using ? and * wildcard characters.

5.10 MPUT

MGET is a console mode program that uploads all files (to the server directory) that match a user specified file specification using ? and * wildcard characters.

5.11 PROXY

PROXY is a console mode program that connects to a FTP server through a proxy server using the "PROXY USER" protocol. Refer to the FCE User's Manual (FCE_USR) for a discussion of proxy servers and proxy protocols; Section 3.6 "Proxy Servers" and Section 3.7 "Proxy Protocols" of the FCE User's Manual (FCE_USR). (http://www.marshallsoft.com/fce_usr.htm#Section_3.6).

Be sure to edit the FTP account information in PROXY.C before compiling.

5.12 SPEED

SPEED is a console mode program designed to test download and upload speeds. Download a file greater than one megabyte for the most accurate results.

5.13 HELLO

HELLO is a console mode program similar to FCEVER (FCE Version) that demonstrates how to use the 'ffce' C++ class.

5.14 VC_VER

VC_VER is a Microsoft Visual C.NET version of the FCEVER (FCE Version) example program.

5.15 CS_VER

CS_VER is a Microsoft C# version of the FCEVER (FCE Version) example program.

5.16 VC_GET

VC_GET is a Microsoft C.NET version of the GET example program.

5.17 CS_GET

CS_GET is a Microsoft C# version of the GET example program.


6 Revision History

Version 1.0 "Beta": February 12, 1999.

Version 1.0: March 22, 1999

Version 1.1: June 14, 1999

Version 1.2: August 10, 1999

Version 2.0: April 24, 2000.

Version 2.1: January 8, 2001.

Version 2.2: September 18, 2001.

Version 2.3: November 15, 2002.

Version 2.4: April 19, 2004.

Version 2.5: July 20, 2005

Version 2.6: January 17, 2007