Original Post
I''m working on a wrapper library for DirectInput and I''m having a problem getting the data from the Device.
The initialization (creating DirectInput object, creating device, setting data format, setting cooperation level) goes fine and so does the call to Acquire, but crashes when a call to GetDeviceState is called.
Since the call to GetDeviceState doesn''t even return, simply crashes, it is as if there is a null pointer, or bad parameter of some sort. But since all the initialization goes fine this is a bit interesting.
This error is even more peculiar because the code works fine if I paste the functions directly into the class that is calling it but fails when calling it from the LIB, even though it is identical.
The SDK mentions using the DLL instance instead of the window instance when calling DirectInput8Create. I''ve tried this also with the same results.
This leaves me wondering if the problem doesn''t lie in an issue with how the visual studio linker and windows handles calling COM objects from external libraries.
Has anybody successfully used an external static or dynamically loaded library to wrap DirectInput?
Thanks,
Andrew