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

# XtfGetDefaultAddress

> XtfGetDefaultAddress

# XtfGetDefaultAddress

傳回此電腦之預設開發主機的 IP 位址。

<a id="syntaxSection" />

## 語法

```cpp theme={null}
HRESULT XtfGetDefaultAddress(
         LPBSTR pbstrAddress
)  
```

<a id="parametersSection" />

### 參數

*pbstrAddress*\
類型：LPBSTR

此電腦用於其預設開發主機的 IP 位址。

<a id="retvalSection" />

### 傳回值

類型：HRESULT

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

<a id="remarksSection" />

## 備註

如果成功，此方法會在 `pbstrAddress` 中取得此電腦之預設開發主機的 IP 位址。您也可以使用 [IXtfConsoleManager::GetDefaultConsole](/zh-TW/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/getdefaultconsole-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m) 方法來擷取預設開發主機的更多資訊，或叫用 [IXtfConsoleManager::SetDefaultConsole](/zh-TW/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/setdefaultconsole-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m) 方法來設定預設開發主機。其他 XBOX Tools Framework (XTF) 工具和 API 會使用預設開發主機。

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

<a id="remarks_output" />

### 處理 LPBSTR 指標

如需處理此方法所傳回之 LPBSTR 指標的詳細資訊，請參閱[配置和釋放 BSTR 的記憶體](https://learn.microsoft.com/cpp/atl-mfc-shared/allocating-and-releasing-memory-for-a-bstr?view=vs-2019)。

<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

- [XtfCreateConsoleManager](/zh-TW/reference/tools/xtf/xtfconsolemanager/methods/xtfcreateconsolemanager-xtfconsolemanager-xbox-microsoft-m.md)
- [XtfGetSavedConsoleAddress](/zh-TW/reference/tools/xtf/xtfapi/functions/xtfgetsavedconsoleaddress-xtfapi-xbox-windows-m.md)
- [IXtfConsoleManager::GetDefaultConsole 方法](/zh-TW/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/getdefaultconsole-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m.md)
- [XtfGetConsoleFieldValue](/zh-TW/reference/tools/xtf/xtfapi/functions/xtfgetconsolefieldvalue-xbox-microsoft-m.md)
- [IXtfConsoleManager::AddConsole 方法](/zh-TW/reference/tools/xtf/xtfconsolemanager/classes/IXtfConsoleManager/methods/addconsole-ixtfconsolemanager-xtfconsolemanager-xbox-microsoft-m.md)
