Hello
I have a MFC Application. The logic for interaction is separated in a DLL library and I want to add the 3Dconnexion interaction code into that DLL (I use VS2008). MFC defines its own DllMain method.
I cannot use attributes and module naming for COM (only if I force it to link with the FORCE:MULTIPLE compiler option). But these are needed to use the functions __hook and __unhook. Is there a way to use callback functions without using attributes and module naming?
What am I currently missing if I use the old SDK? Will future devices also work with this old SDK?
MFC DLL and Attributed COM
Moderator: Moderators
To initialize the driver I use the following sequence:
if (SiInitialize() == SPW_DLL_LOAD_ERROR)
{
return;
}
SiOpenData spaceballData;
SiOpenWinInit(&spaceballData, m_hWnd);
SiSetUiMode(&m_hSpaceball, SI_UI_ALL_CONTROLS);
if ((m_hSpaceball = SiOpen("Test", SI_ANY_DEVICE, SI_NO_MASK, SI_EVENT, &spaceballData)) == NULL)
{
SiTerminate();
}
The problem is when the driver is not running I have quite a long timeout.
How can I detect whether a Spaceball device is plugged in?
How can I detect whether a Spaceball device is plugged out?
Is this only possible with other APIs?
if (SiInitialize() == SPW_DLL_LOAD_ERROR)
{
return;
}
SiOpenData spaceballData;
SiOpenWinInit(&spaceballData, m_hWnd);
SiSetUiMode(&m_hSpaceball, SI_UI_ALL_CONTROLS);
if ((m_hSpaceball = SiOpen("Test", SI_ANY_DEVICE, SI_NO_MASK, SI_EVENT, &spaceballData)) == NULL)
{
SiTerminate();
}
The problem is when the driver is not running I have quite a long timeout.
How can I detect whether a Spaceball device is plugged in?
How can I detect whether a Spaceball device is plugged out?
Is this only possible with other APIs?
Hmmm. That reply got lost.
The window name hasn't changed in 10 years. It won't ever be changed.
It is currently sufficient to check for this window to tell if a 3Dx device is attached because the driver quits if it doesn't find a device attached.
In the next major driver release, though, the driver will run continuously even with no device attached. You can make an API call to find out if there really is a device is attached. Furthermore, you will get an event when a device arrives / departs. OTOH, your delay issue will go away since the current delay you are seeing is from the API starting the driver and it searching for any connected devices. Since it will be running continually it will respond instantly.
The window name hasn't changed in 10 years. It won't ever be changed.
It is currently sufficient to check for this window to tell if a 3Dx device is attached because the driver quits if it doesn't find a device attached.
In the next major driver release, though, the driver will run continuously even with no device attached. You can make an API call to find out if there really is a device is attached. Furthermore, you will get an event when a device arrives / departs. OTOH, your delay issue will go away since the current delay you are seeing is from the API starting the driver and it searching for any connected devices. Since it will be running continually it will respond instantly.
