I'm trying to use ActiveWire and it's usb dll, but I'm having a little trouble.
In the documentation it says...
"If your application needs to open 2 or more devices, create threads, load DLL in each thread, then open device with different devnum."
However, in Windows when I use CreateThread (included in windows.h) to create a thread with the LoadLibrary function in it, the new thread does not create an unique handle. Eg. when opening a second device, it would only allow me to access that second device in BOTH threads.
I'm not sure if this is relevant, but in hunting for the problem I can safely say that LoadLibrary in both threads returns the same exact handle instance (id).
I've also found that when I start a second process loading the same DLL, it will in fact allow me to access two different devices at the same time. However, I'd like it to have access to different devices in differents threads but in the same process.
I have found an alternate solutions to my problem, however it's a dirty fix and would like to do otherwise:
Create copies of the dll: Eg. copy awusb.dll to another file like awusb0.dll and awusb1.dll and call LoadLibrary( "awusb0.dll" ) for one thread, and "awusb1.dll" for the other.
Does anyone have any ideas? Any help would be appreciated.
In the documentation it says...
"If your application needs to open 2 or more devices, create threads, load DLL in each thread, then open device with different devnum."
However, in Windows when I use CreateThread (included in windows.h) to create a thread with the LoadLibrary function in it, the new thread does not create an unique handle. Eg. when opening a second device, it would only allow me to access that second device in BOTH threads.
I'm not sure if this is relevant, but in hunting for the problem I can safely say that LoadLibrary in both threads returns the same exact handle instance (id).
I've also found that when I start a second process loading the same DLL, it will in fact allow me to access two different devices at the same time. However, I'd like it to have access to different devices in differents threads but in the same process.
I have found an alternate solutions to my problem, however it's a dirty fix and would like to do otherwise:
Create copies of the dll: Eg. copy awusb.dll to another file like awusb0.dll and awusb1.dll and call LoadLibrary( "awusb0.dll" ) for one thread, and "awusb1.dll" for the other.
Does anyone have any ideas? Any help would be appreciated.