Share via


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 use the file name extension .fll for the DLL file.

Each type of program has advantages. ActiveX controls have the following advantages:

  • 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.

COM objects have the following advantages:

  • 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.

Visual FoxPro dynamic-link (.fll) libraries might be more familiar to you if you have used previous versions of Visual FoxPro.

See Also

Tasks

How to: Create a Basic ActiveX Object

Concepts

Creating Visual FoxPro Dynamic-Link Libraries

Other Resources

Accessing the Visual FoxPro API