Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions can/interfaces/vector/xldriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@

# Load Windows DLL
DLL_NAME = "vxlapi64" if platform.architecture()[0] == "64bit" else "vxlapi"
if dll_path := find_library(DLL_NAME):
_xlapi_dll = ctypes.windll.LoadLibrary(dll_path)
else:
raise FileNotFoundError(f"Vector XL library not found: {DLL_NAME}")
# attempt to load Vector XL Driver DLL in a way that accomodates DLL directories added with os.add_dll_directory()
try:
_xlapi_dll = ctypes.windll.LoadLibrary(DLL_NAME)
except:
raise

# ctypes wrapping for API functions
xlGetErrorString = _xlapi_dll.xlGetErrorString
Expand Down
Loading