Dll written in C
extern int32_T myinput; extern int32_T myoutput; extern void initialize(void); extern void run(void); extern void terminate(void); void run(void) { myoutput = myinput * 2; }
Python script
from ctypes import* mydll = cdll.LoadLibrary("C:\\myDLL.dll") mydll.myinput = 10
My expectation
20
Actual output
<_FuncPtr object at 0x00000000023646C8>
My question
- How to assign a global variable in a DLL?
- How to get global variable in DLL?
In short, could you modify my script to conclude 20?
source share