> ## 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 方法

> IXtfConsoleManager::GetDefaultConsole 方法

# IXtfConsoleManager::GetDefaultConsole 方法

從 [IXtfConsoleManager](/zh-TW/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](/zh-TW/reference/tools/xtf/xtfconsolemanager/structures/xtfconsoledata-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 搭配使用之預設開發主機的相關資訊。在此電腦上使用 XTF 工具和 API 時，如果未另外指定開發主機，就會使用預設開發主機。

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

<a id="requirementsSection" />

## 需求

**標頭：** xtfconsolemanager.h

**程式庫：** xtfconsolemanager.lib

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

<a id="seealsoSection" />

## 另請參閱

[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

- [IXtfConsoleManager::EnumerateConsoles 方法](/zh-TW/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/enumerateconsoles-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m.md)
- [IXtfEnumerateConsolesCallback::OnConsoleFound 方法](/zh-TW/reference/tools/xtf/xtfconsolemanager/classes/IXtfEnumerateConsolesCallback/methods/onconsolefound-ixtfenumerateconsolescallback-xtfconsolemanager-xbox-mi.md)
- [XtfGetSavedConsoleAddress](/zh-TW/reference/tools/xtf/xtfapi/functions/xtfgetsavedconsoleaddress-xtfapi-xbox-windows-m.md)
- [XtfGetDefaultAddress](/zh-TW/reference/tools/xtf/xtfconsolemanager/methods/xtfgetdefaultaddress-xtfconsolemanager-xbox-windows-m.md)
- [IXtfConsoleManager::SetDefaultConsole 方法](/zh-TW/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/setdefaultconsole-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m.md)
