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

# IXtfEnumerateConsolesCallback::OnConsoleFound Method

> IXtfEnumerateConsolesCallback::OnConsoleFound Method

# IXtfEnumerateConsolesCallback::OnConsoleFound Method

在 [IXtfConsoleManager::EnumerateConsoles](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/enumerateconsoles-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m) 操作期间发现开发主机时调用。

<a id="syntaxSection" />

## 语法

```cpp theme={null}
public:
HRESULT OnConsoleFound(
         const XTFCONSOLEDATA *pConsoleData
)  
```

<a id="parametersSection" />

### 参数

*pConsoleData*\
类型：XTFCONSOLEDATA\*

接收 [XTFCONSOLEDATA](/reference/tools/xtf/xtfconsolemanager/structures/xtfconsoledata-xtfconsolemanager-xbox-microsoft-t) 结构的指针，该结构包含有关所找到开发主机的信息。

<a id="retvalSection" />

### 返回值

类型：HRESULT

如果成功，则返回 `S_OK`；否则返回 HRESULT 错误代码。

<a id="remarksSection" />

## 备注

在调用 [IXtfConsoleManager](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-t) 实例的 [EnumerateConsoles](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/enumerateconsoles-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m) 方法期间，对于该实例中找到的每个开发主机，该实例都会调用此回调方法。此方法提供有关找到的开发主机的信息，包括名称和工具 IP 地址。

有关连接和查询开发主机的详细信息，请参阅 [Connect (xbconnect.exe) (NDA 主题)](/tools/tools-console/commandlinetools/xbconnect)。

<a id="requirementsSection" />

## 要求

**头文件：** xtfconsolemanager.h

**库：** xtfconsolemanager.lib

**支持的平台：** Windows（适用于 XBOX 主机工具）

<a id="seealsoSection" />

## 另请参阅

[IXtfConsoleManager::GetConsole Method](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/getconsole-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m)\
[IXtfConsoleManager::GetDefaultConsole Method](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/getdefaultconsole-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m)\
[IXtfEnumerateConsolesCallback Interface](/reference/tools/xtf/xtfconsolemanager/classes/IXtfEnumerateConsolesCallback/ixtfenumerateconsolescallback-xtfconsolemanager-xbox-microsoft-t)\
[XtfConsoleManager](/reference/tools/xtf/xtfconsolemanager/xtfconsolemanager-xbox-microsoft-n)


## Related topics

- [IXtfConsoleManager::EnumerateConsoles method](/zh-CN/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/enumerateconsoles-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m.md)
- [IXtfConsoleManagerCallback::OnAddConsole Method](/zh-CN/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManagerCallback/methods/onaddconsole-ixtfconsolemanagercallback-xtfconsolemanager-xbox-microsoft.md)
- [IXtfConsoleManagerCallback::OnRemoveConsole Method](/zh-CN/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManagerCallback/methods/onremoveconsole-ixtfconsolemanagercallback-xtfconsolemanager-xbox-microso.md)
- [IXtfConsoleManagerCallback::OnChangedDefaultConsole Method](/zh-CN/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManagerCallback/methods/onchangeddefaultconsole-ixtfconsolemanagercallback-xtfconsolemanager-xbox.md)
- [XTFCONSOLEDATA Structure](/zh-CN/reference/tools/xtf/xtfconsolemanager/structures/xtfconsoledata-xtfconsolemanager-xbox-microsoft-t.md)
