The IDirectInputDevice2 interface inherits all the methods of IDirectInputDevice, and adds methods for polling devices and using force feedback. The inherited methods are unchanged, and it is unnecessary to obtain this interface unless you want to use the new methods.
The IDirectInputDevice2 interface is obtained by calling the IDirectInputDevice::QueryInterface method. For an example, see Creating a DirectInput Device.
The new methods of the IDirectInputDevice2 interface can be grouped as follows:
Polling | Poll |
Effects | CreateEffect |
EnumCreatedEffectObjects | |
EnumEffects | |
GetEffectInfo | |
Control | Escape |
SendDeviceData | |
SendForceFeedbackCommand | |
Status | GetForceFeedbackState |
The IDirectInputDevice2 interface, like all COM interfaces, inherits the IUnknown interface methods. The IUnknown interface supports the following three methods:
IUnknown | AddRef |
QueryInterface | |
Release |
The LPDIRECTINPUTDEVICE2 type is defined as a pointer to the IDirectInputDevice2 interface:
typedef struct IDirectInputDevice2 *LPDIRECTINPUTDEVICE2;
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in dinput.h.
Import Library: Use dinput.lib.