The IDirectInputDevice::GetObjectInfo method retrieves information about a device object such as a button or axis.
HRESULT GetObjectInfo(
LPDIDEVICEOBJECTINSTANCE pdidoi,
DWORD dwObj,
DWORD dwHow
);
Value | Meaning |
---|---|
DIPH_DEVICE | The dwObj parameter must be zero. |
DIPH_BYOFFSET | The dwObj parameter is the offset into the current data format of the object whose information is being accessed. |
DIPH_BYID | The dwObj parameter is the object type/instance identifier. This identifier is returned in the dwType member of the DIDEVICEOBJECTINSTANCE structure returned from a previous call to the IDirectInputDevice::EnumObjects method. |
DIPH_BYUSAGE | The dwObj parameter contains the HID Usage Page and Usage values of the object, combined by the DIMAKEUSAGEDWORD macro. |
If the method succeeds, the return value is DI_OK.
If the method fails, the return value may be one of the following error values:
DIERR_INVALIDPARAM |
DIERR_NOTINITIALIZED |
DIERR_OBJECTNOTFOUND |
For compatibility with DirectX 3, it is also valid to pass a DIDEVICEOBJECTINSTANCE_DX3 structure with the dwSize member initialized to sizeof(DIDEVICEOBJECTINSTANCE_DX3). For more information, see Designing for Previous Versions of DirectInput.
Windows NT: Use version 5.0 or later.
Windows: Use Windows 95 or later. Available as a redistributable for Windows 95.
Windows CE: Unsupported.
Header: Declared in dinput.h.
Import Library: Use dinput.lib.