- Joined
- Jul 5, 2007
- Messages
- 1
- Reaction score
- 0
I am currently writing a program that will use a force feedback joystick. The one I am using is Microsoft Force Feedback Sidewinder 2.
I am able to create, acquire, and use the device.
I am even able to create some effects.
My problem:
If while my test program is running, and the joystick is unplugged, then I call the uninitialize method where the effects and joystick device are unacquired and released.
Then, I enter a loop where I continuously try to re-initialize the device.
If I plug the device back in, the joystick initializes fine and I can use it, except I get a failure when I try to recreate the effects. Thus, the Joystick functions without any effects.
That is, after the joystick is re-created, and acquired this line fails:
g_lpDIDeviceJoystick->CreateEffect(GUID_Spring,&springEffect,&g_pFFEffect[FF_EFFECT_SPRING],NULL)
I am not sure why, but it is as if the device has not released the effect, and it cannot recreate it.
Any suggestions?
Thank you.
I am able to create, acquire, and use the device.
I am even able to create some effects.
My problem:
If while my test program is running, and the joystick is unplugged, then I call the uninitialize method where the effects and joystick device are unacquired and released.
Then, I enter a loop where I continuously try to re-initialize the device.
If I plug the device back in, the joystick initializes fine and I can use it, except I get a failure when I try to recreate the effects. Thus, the Joystick functions without any effects.
That is, after the joystick is re-created, and acquired this line fails:
g_lpDIDeviceJoystick->CreateEffect(GUID_Spring,&springEffect,&g_pFFEffect[FF_EFFECT_SPRING],NULL)
I am not sure why, but it is as if the device has not released the effect, and it cannot recreate it.
Any suggestions?
Thank you.