> ## 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](/zh-TW/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](/zh-TW/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManagerCallback/ixtfconsolemanagercallback-xtfconsolemanager-xbox-microsoft-t) 回呼的指標，當 [IXtfConsoleManager](/zh-TW/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-t) 執行個體中的開發主機被新增、移除或變更時，就會叫用此回呼。

*riid*\
類型：REFIID

接收新建立之 [IXtfConsoleManager](/zh-TW/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-t) 執行個體之執行個體識別碼的指標。

*ppvObject*\
類型：void\*\*

接收新建立之 [IXtfConsoleManager](/zh-TW/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-t) 執行個體參考的指標。

<a id="retvalSection" />

### 傳回值

類型：HRESULT

如果成功，則傳回 `S_OK`；否則傳回 HRESULT 錯誤碼。

<a id="remarksSection" />

## 備註

此函式會初始化 [IXtfConsoleManager](/zh-TW/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-t) 介面的執行個體。此介面會處理 XBOX Tools Framework (XTF) API 的常見主機管理功能。這些功能包括新增、列舉和移除開發主機；取得和設定預設開發主機；以及擷取開發主機的相關資訊。

如需連線和查詢開發主機的詳細資訊，請參閱[連線 (xbconnect.exe) (NDA 主題)](/zh-TW/tools/tools-console/commandlinetools/xbconnect)。

<a id="requirementsSection" />

## 需求

**標頭：** xtfconsolemanager.h

**程式庫：** xtfconsolemanager.lib

**支援的平台：** Windows (適用於 XBOX 主機工具)

<a id="seealsoSection" />

## 另請參閱

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


## Related topics

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