An FLL (C DLL) accesses the VFP API. The VFP API is designed to let developers extend the abilities of Visual FoxPro which can be done by FLLs (or ActiveX). The pro of using a FLL is that you can compile it into your VFP program, it doesnÆt has to be registered (ActiveX has to be registered) FLLs are written in Visual C(++) which results in fast and small code..
In Visual C++ 6 Select the File->New menu In the New dialog Select the type of project (Win32 Dynamic-Link Library), enter nameofproject and location. Select the simple DLL project option A .dsw file is created (developer studio workspace) Additional files are generated and added (stdafx.cpp, nameofproject.cpp and stdafx.h) Select the ôSet Active Configurationö option from the Build system menu. Select the Win32 Release item and click OK Specify the multi-thread runtime lib for linking. (for the release config this is the msvcrtxx.dll, for the debug config this is the msvcrtdxx.dll) Select the Settings menu option from the Project System menu. This brings up the Project Settings dialog. Select the C/C++ page of the page frame provided on the right and select the Code Generation item from the Category combo box, the Multithreaded DLL item from the Use runtime library combo box, and the __fastcall item from the Calling convention combo box. Change the output file extention, select the Link page provided in the Project Settings dialog, select the General item from the Category combo box. Use the Output file name text box to replace ".dll" with ".fll". Add winapims.lib to the front of the list of object/library modules. The pro_ext.h (always in the .cpp file as an include) and winapims.lib files are located in the API subdirectory of VFP Samples Select Build > Build nameofproject.fll from the menu and if there are no errors and no warnings reported the FLL was successfully built in the release directory
In Visual C++ 7/8 New Project dialog Select the type of project (Win32 Project Template) and enter name. Select Application Settings in the left pane and select the DLL option for Application type A .sln file is created (solution project) Additional files are generated and added (stdafx.cpp, nameofproject.cpp and stdafx.h) Select Project Properties (right-click on the projectÆs Solution Explorer / selecting Properties from the Context menu) Specify the multi-thread runtime lib for linking. (for the release config this is the msvcrtxx.dll, for the debug config this is the msvcrtdxx.dll) Select the Code Generation node under Configuration Properties C/C++ in the Property Pages of the project. Then, select the Multi-threaded DLL (/MD) item from the Runtime Library combo box. (/MD is the compiler switch used.) Switch to the Advanced node, set the FLLÆs calling convention to __fastcall by selecting the appropriate item from the Calling Convention combo box. Change the output file extention, you do this by clicking into the Linker node of the Configuration Properties selecting the General page. In the Output File combo box of the right pane, change the extension by typing ".fll". Click on the Input node underneath the Linker Configuration Properties in the Property Pages, select the Additional Dependencies row in the right pane. Click on the ellipsis button, the Additional Dependencies dialog opens. Type in the name of the library, winapims.lib, and click on the OK button to save the change. The pro_ext.h (always in the .cpp file as an include) and winapims.lib files are located in the API subdirectory of VFP Samples. Select Build > Build nameoftheproject option from the menu. Visual C++ builds the project. If there are no errors and no warnings, the FLL was successfully built in the release directory
An example of sourcecode for a FLL ( a .cpp file )