I am trying to use the python ctypes library to access various functions in a COM DLL created in Visual Fox Pro (from a .prg file).
Here is an example in fox pro (simplified from the actual code)
DEFINE CLASS Testing AS CUSTOM OLEPUBLIC PROCEDURE INIT ON ERROR SET CONSOLE OFF SET NOTIFY OFF SET SAFETY OFF SET TALK OFF SET NOTIFY OFF ENDPROC FUNCTION get_input_out(input AS STRING) AS STRING output = input RETURN output ENDFUNC ENDDEFINE
In python i am doing something along the lines of:
import ctypes link = ctypes.WinDLL("path\to\com.dll") print link.get_input_out("someinput")
The dll registers fine and is loaded but i just get the following when I try to call the function.
AttributeError: function 'get_input_out' not found
I can verfiy the dll does work as i was able to access the functions with a php script using the COM libary.
I would really like to get this working in python but so far my attempts have all been in vain, will ctypes even work with VFP? Any advice would be appreciated.