jwick wrote:Hi calques3d,
IsConnected() is only associated with the calls to Connect() and Disconnect() methods, not with a physical bit of hardware, nor with 3dxware.
The best method to find out if you do not have a device attached is to check what type of device is being serviced by using _p3DxDevice.get_Type(&type). (0 == UNKNOWN == None)
When a new device is attached i.e. 3dxware startsup again, the devices DeviceChange event is fired
Thanks for the hint,
jwick.
I tried your idea but same effect: if I unplug the USB cable or if I manually stop the driver, I still get type==6. I even tried to start my application with the USB unplugged, same result.
It seems to me that the hardware detection is not working or at least not signaled to my app. I don't know if it is a problem with the SpaceNavigator installation, with WinXP witself or ith the VC++ I'm using.
BTW, I cannot use the DeviceChange event because I am still using VC++6 and __hook/__unhook are only available in VC++2005. I am looking for a compatible alternative. In the mean time, I am using the Timer event and check the previous code every time (not very efficient but will do for the time being).
Any other idea I could try?