VFP2C32 Package
The distribution contains the following directories:
vfp2c32 | Contains the FLL and all supporting files. |
vfp2c32examples | Contains an example project. |
vfp2c32front | VFP2C32 Front is a supporting program which translates C struct, union and enum types into VFP code. |
Integration into you project
Add vfp2c32.fll and vfp2c.h to your project - both excluded from the application/executable.
If you need to pass C style arrays to a C library you'll want to have a look at the classes defined in vfp2carray.prg and also include it.
vfp2c32t.fll is the threadsafe version of the library, you can use it in multithreaded VFP COM dlls.
Initialization/cleanup of the library
&& somewhere at your programs startup code #INCLUDE vfp2c.h SET LIBRARY TO vfp2c32.fll ADDITIVE IF !InitVFP2C32(VFP2C_INIT_ALL) && you can vary the initialization parameter depending on what functions of the FLL you intend to use LOCAL laError[1], lnCount, xj, lcError lnCount = AERROREX('laError') lcError = 'VFP2C32 Library initialization failed:' + CHR(13) FOR xj = 1 TO lnCount lcError = lcError + ; 'Error No : ' + TRANSFORM(laError[1]) + CHR(13) + ; 'Function : ' + laError[2] + CHR(13) + ; 'Message : "' + laError[3] + '"' ENDFOR && show/log error and abort program initialization .. ENDIF
Deployment
Just place a copy of vfp2c32.fll/vfp2c32t.fll and msvcr71.dll in your application directory structure, NOT in Windows\System32.