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

# XtfCreateConsoleManager

> XtfCreateConsoleManager

# XtfCreateConsoleManager

初始化 [IXtfConsoleManager](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-t) 接口的新实例。

<a id="syntaxSection" />

## 语法

```cpp theme={null}
HRESULT XtfCreateConsoleManager(
         IXtfConsoleManagerCallback *pCallback,
         REFIID riid,
         void **ppvObject
)  
```

<a id="parametersSection" />

### 参数

*pCallback*\
类型：IXtfConsoleManagerCallback\*

指向 [IXtfConsoleManagerCallback](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManagerCallback/ixtfconsolemanagercallback-xtfconsolemanager-xbox-microsoft-t) 回调的指针，当添加、移除或更改 [IXtfConsoleManager](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-t) 实例中的开发主机时调用此回调。

*riid*\
类型：REFIID

接收新创建的 [IXtfConsoleManager](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-t) 实例的实例标识符的指针。

*ppvObject*\
类型：void\*\*

接收对新创建的 [IXtfConsoleManager](/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/ixtfconsolemanager-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) 接口的实例。该接口处理 XBOX Tools Framework (XTF) API 的常见主机管理函数。这些函数包括添加、枚举和移除开发主机；获取和设置默认开发主机；以及检索有关开发主机的信息。

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

<a id="requirementsSection" />

## 要求

**头文件：** xtfconsolemanager.h

**库：** xtfconsolemanager.lib

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

<a id="seealsoSection" />

## 另请参阅

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


## Related topics

- [IXtfConsoleManager::AddConsole method](/zh-CN/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/addconsole-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m.md)
- [IXtfConsoleManager::EnumerateConsoles method](/zh-CN/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/enumerateconsoles-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m.md)
- [XtfCreateConsoleControlClient](/zh-CN/reference/tools/xtf/xtfconsolecontrol/functions/xtfcreateconsolecontrolclient-xtfconsolecontrol-xbox-microsoft-m.md)
- [IXtfConsoleManager::GetConsole Method](/zh-CN/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/getconsole-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m.md)
- [IXtfConsoleManager::RemoveConsole Method](/zh-CN/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/removeconsole-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m.md)
