I have used a C++ dll using MFC and I would like to call it from python. This dll contains this header in the .h file
LONG CommOpen(BYTE port, LONG baud_rate);
Then I see in the free software dllexp that my function is called ?CommOpen@CFIPcmd@@QAEJEJ@Z in the binary file so no error is reported when I do in python
import ctypes
lib = ctypes.WinDLL('C:\\Users\\toto\\FIProtocol.dll')
prototype = WINFUNCTYPE(c_long, c_byte, c_long)
testPt = ctypes.WINFUNCTYPE (prototype)
testApi = testPt (("?CommOpen@CFIPcmd@@QAEJEJ@Z", lib))
Until there it seems to work but then I would like to call the in Python the equivalent in C++ of
Long l= CommOpen(5 ,115200);
But I Didn't find know how to proceed. Any help would be really appreciated!!