Library or ActiveX Object Creation

You can extend the capabilities of Visual FoxPro by creating programs in C or C++ that accomplish tasks required by your application. For example, if your application requires direct access to Windows facilities, you can write a C or C++ program that makes calls to the Windows API, and then returns information to Visual FoxPro.

You can create three types of programs to access the Visual FoxPro API:

  • An ActiveX control (.ocx file).
  • A COM object.
  • A DLL specific to Visual FoxPro. Because the DLL can be called only from Visual FoxPro, it is customary to name it with the extension .fll.

Each type of program has advantages. An ActiveX control:

  • Can be accessed using standard object-oriented techniques, such as setting its properties and invoking its methods.
  • Can be subclassed, and its methods overridden.
  • Is encapsulated, and can be called (instantiated) multiple times without complex environment management to preserve user states.
  • Features simpler parameter passing.
  • Can also be called from other Windows programs, if you program it with this in mind.

The advantages of COM objects:

  • Can be accessed using standard object-oriented techniques, such as setting its properties and invoking its methods.
  • Its methods can be overridden.
  • Is encapsulated, and can be called (instantiated) multiple times without complex environment management to preserve user states.
  • Features simpler parameter passing.
  • Can also be called from other Windows programs, if you program it with this in mind.

On the other hand, an .fll library:

  • Might be familiar to you if you've used previous versions of Visual FoxPro.

See Also

Accessing the Visual FoxPro API | API Library Construction | Creating a Basic ActiveX Object | Creating a Basic FLL Library | Extending Visual FoxPro with External Libraries | Adding Visual FoxPro API Calls