>I have been asked a question by someone interested in using VFP for a project, and I do not have an answer. They are currently using VB for a project, but it is becoming database intensive and they want to switch to VFP. However, they are calling a c library from VB and they need to make sure they can also call this library from VFP. If so, I would also like to know which versions of VFP can do this. Also, is there anything inparticular that needs to be done. I'm afraid I haven't had to call any libraries while using VFP so I am fairly ignorant on the subject. Thank you in advance,
If the C library is a .DLL that uses C-style calls, you may be able to access it simply by using the DECLARE...DLL command to define the entrypoints and types of parameters passed if the parameters are of a type natively supported by VFP. If this is not the case, you may need to create data structures in memory using a tool like Paul Tatavu's POINTERS class or my CLSHEAP class (both can be downloaded from UT's File Section.)
If the C library is accessed as methods of an OLE Automation server or ActiveX control, then VFP 5 or 6 will more than likely be able to use it. ActiveX controls which are containers, or require support of non-native system events, may be problems.
if the C library is provided as a static library which must be linked into compiled code, you'll have to write something as a shell around it to expose its entrypoints as methods of an OLE Server or as entrypoints of a C-style .DLL, or incorporate it into a .FLL (a .FLL is most easily explained as a VFP-specific variant of a .DLL, which can interact with VFP very closely.)