1
This commit is contained in:
@@ -1,9 +1,22 @@
|
||||
import ctypes
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Load DLL
|
||||
dll_path = os.path.join(os.path.dirname(__file__), "libs", "atcore.dll")
|
||||
lib = ctypes.CDLL(dll_path, winmode=0)
|
||||
# Add DLL directory to PATH
|
||||
dll_dir = os.path.join(os.path.dirname(__file__), "libs")
|
||||
old_path = os.environ.get("PATH", "")
|
||||
os.environ["PATH"] = dll_dir + os.pathsep + old_path
|
||||
|
||||
# Load DLL with stdcall convention
|
||||
if hasattr(os, "add_dll_directory"):
|
||||
os.add_dll_directory(dll_dir)
|
||||
lib = ctypes.windll.LoadLibrary("atcore.dll")
|
||||
else:
|
||||
dll_path = os.path.join(dll_dir, "atcore.dll")
|
||||
lib = ctypes.windll.LoadLibrary(dll_path)
|
||||
|
||||
# Restore PATH
|
||||
os.environ["PATH"] = old_path
|
||||
|
||||
# Type definitions
|
||||
AT_H = ctypes.c_int
|
||||
|
||||
Reference in New Issue
Block a user