I used a sharedvar.dll with Multicharts without any issue, I try with Python 3.10 but get some error:
here my script:
from ctypes import *
# DLL , RETURN VALUE , FUCTION NAME, PARAMS
#DefineDLLFunc: "C:\Windows\SharedVar-a64.dll", int, "svInit", string;
#DefineDLLFunc: "C:\Windows\SharedVar-a64.dll", int, "svGetInt", int,string;
#DefineDLLFunc: "C:\Windows\SharedVar-a64.dll", bool, "svSetValue", int,string,double;
#DefineDLLFunc: "C:\Windows\SharedVar-a64.dll", bool, "svGetBool", int,string;
#DefineDLLFunc: "C:\Windows\SharedVar-a64.dll", string, "svGetString", int,string;
#DefineDLLFunc: "C:\Windows\SharedVar-a64.dll", double, "svGetDouble", int,string;
#DefineDLLFunc: "C:\Windows\SharedVar-a64.dll", bool, "svSetString", int,string,string;
#Windows sharedvar server software https://fx1.net/sharedvar.php#id1
c_lib = "C:\\Windows\\SharedVar-a64.dll"
Symbol = "15"
lib = cdll.LoadLibrary(c_lib)
print(lib)
#load ok
lib.svInit.argtype = [c_wchar_p]
lib.svInit.restype = c_double
#linkID = lib.svInit(Symbol)
linkID = lib.svInit("15")
#lib.svGetDouble.restype = c_int64
lib.svGetDouble.restype = c_int
lib.svGetDouble.argtype = [c_int, c_wchar_p]
ret = lib.svGetDouble(linkID, "PC")
print(ret)
error :
C:\Users\Gilles\PycharmProjects\pythonProject\sockets-python-master\venv\Scripts\python.exe "C:/Users/Gilles/PycharmProjects/pythonProject/sockets-python-master/test shared2.py"
<CDLL 'C:\Windows\SharedVar-a64.dll', handle 7ffa05b60000 at 0x1ac76f42e00>
Traceback (most recent call last):
File "C:\Users\Gilles\PycharmProjects\pythonProject\sockets-python-master\test shared2.py", line 26, in <module>
linkID = lib.svInit("15")
OSError: [WinError -532462766] Windows Error 0xe0434352
Process finished with exit code 1