> ## 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.

# IXtfConsoleManager::GetDefaultConsole Method

> IXtfConsoleManager::GetDefaultConsole Method

# IXtfConsoleManager::GetDefaultConsole Method

从 [IXtfConsoleManager](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-t) 实例中获取默认开发主机的相关信息。

<a id="syntaxSection" />

## 语法

```cpp theme={null}
public:
HRESULT GetDefaultConsole(
         PXTFCONSOLEDATA pConsoleData
)  
```

<a id="parametersSection" />

### 参数

*pConsoleData*\
类型：PXTFCONSOLEDATA

接收 [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) 实例中获取要在此 PC 上与 XBOX Tools Framework (XTF) 工具和 API 一起使用的默认开发主机的相关信息。如果在此 PC 上使用 XTF 工具和 API 时未另行指定开发主机，则将使用默认开发主机。

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

<a id="requirementsSection" />

## 要求

**头文件：** xtfconsolemanager.h

**库：** xtfconsolemanager.lib

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

<a id="seealsoSection" />

## 另请参阅

[IXtfConsoleManager Interface](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-t)\
[XtfConsoleManager](/reference/tools/xtf/xtfconsolemanager/xtfconsolemanager-xbox-microsoft-n)


## Related topics

- [IXtfEnumerateConsolesCallback::OnConsoleFound Method](/zh-CN/reference/tools/xtf/xtfconsolemanager/classes/IXtfEnumerateConsolesCallback/methods/onconsolefound-ixtfenumerateconsolescallback-xtfconsolemanager-xbox-mi.md)
- [IXtfConsoleManager::EnumerateConsoles method](/zh-CN/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/enumerateconsoles-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m.md)
- [IXtfConsoleManager::SetDefaultConsole Method](/zh-CN/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/setdefaultconsole-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m.md)
- [IXtfConsoleManagerCallback::OnChangedDefaultConsole Method](/zh-CN/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManagerCallback/methods/onchangeddefaultconsole-ixtfconsolemanagercallback-xtfconsolemanager-xbox.md)
- [IXtfConsoleManager::AddConsole method](/zh-CN/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/addconsole-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m.md)
