> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IGameInput::FindDeviceFromObject（已弃用）

> IGameInput::FindDeviceFromObject

# IGameInput::FindDeviceFromObject

> [!WARNING]
>
> **已弃用。** 此方法已在 GameInput v1 中移除，当前 API 中不再提供。

基于匹配的平台 COM 对象引用检索 [IGameInputDevice](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md) 接口。

## 语法

```cpp theme={null}
HRESULT FindDeviceFromObject(
    IUnknown* value,
    IGameInputDevice** device
);
```

### 参数

*value*   \_In\_\
类型：IUnknown\*

要匹配的平台 COM 对象（例如 IDirectInputDevice8 实例）。

*device*   \_COM\_Outptr\_\
类型：IGameInputDevice\*\*

返回的 [IGameInputDevice](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md) 接口。

### 返回值

类型：HRESULT

返回 E\_NOTIMPL，因为此方法在 v0 中从未实现。

## 备注

此方法允许应用程序从现有的平台对象（例如 DirectInput 设备）获取 GameInput 设备接口。此方法已在 v1 中移除。当前的替代方案是 [FindDeviceFromId](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinput/methods/igameinput_finddevicefromid.md) 和 [FindDeviceFromPlatformString](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinput/methods/igameinput_finddevicefromplatformstring.md)。

## 版本历史

| 版本 | 变更 |
| - | - |
| **v1** | 已移除。 |
| **v0** | 已引入。 |

## 另请参阅

[已弃用的 GameInput API 成员](https://docs.xbox.com/zh-CN/reference/input/gameinput/deprecated/gameinput_deprecated_members.md)\
[IGameInput::FindDeviceFromId](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinput/methods/igameinput_finddevicefromid.md)\
[IGameInput::FindDeviceFromPlatformString](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinput/methods/igameinput_finddevicefromplatformstring.md)\
[IGameInput](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinput/igameinput.md)


## Related topics

- [IGameInput::FindDeviceFromPlatformHandle（已弃用）](https://docs.xbox.com/zh-CN/reference/input/gameinput/deprecated/interfaces/igameinput/methods/igameinput_finddevicefromplatformhandle.md)
- [IGameInput::EnableOemDeviceSupport（已弃用）](https://docs.xbox.com/zh-CN/reference/input/gameinput/deprecated/interfaces/igameinput/methods/igameinput_enableoemdevicesupport.md)
- [IGameInputDevice::PowerOff（已弃用）](https://docs.xbox.com/zh-CN/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_poweroff.md)
- [IGameInputDevice::GetRawDeviceFeature（已弃用）](https://docs.xbox.com/zh-CN/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_getrawdevicefeature.md)
- [IGameInputDevice::SetRawDeviceFeature（已弃用）](https://docs.xbox.com/zh-CN/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_setrawdevicefeature.md)
