If 3Dx software is installed, then CoCreateInstance is expected to succeed.
Regardless of whether a SpaceXXX device is plugged in, we expect dev->Connect() to succeed after that.
So ... how to tell whether the user has a real device plugged in, or software installed but device unplugged? (This is quite likely on a laptop!)
I don't want to put up additional navigation menus if the user has no means to use them...
Hey there, one way to do that for sure is to chek windows device list.
You got to ways.
1. My.Computer.Hardware scope and then select the space navigator name... what ever it is
2. use HID class and chek spesifuc Vendor and Product ID to pinpoint spesific usb device, in this way you will even be able to tell if 2 devices of the same categoty are plugged in .
I can post sample code but only in MS Visual Basic.... I'm no friend with C++
#define UnknownDevice 0
long type;
hr = dev->get_Type(&type);
if (type==UnknownDevice) throw "ErrNoActualDeviceConnected";
or is there a more specific test?
No. Testing the device type is how we recommend to test for an attached and functioning device. You will also receive the same result if the driver s not running.
Once a device is attached or the driver is started you will receive a Device::DeviceChange signal.
neil_at_informatix wrote:
BTW - what happens if some oddball user plugs in two SpaceXX devices? Two the same? Two different ones?
With two devices attached only one is handled by the 3dxware driver. In the case of identical devices the driver will serve the first one it enumerates.
In the case of different devices the driver will serve the device with more value added features.
this code sort of works, except that m_device.Type is always returning 6 whether the mouse is plugged in or not. What might be causing this, and how can we get around it?
Currently, you will received the id of the last device plugged in. i.e the driver does not inform anyone that the device has been removed
in the mean time.