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

# XGameUiShowErrorDialogAsync

> XGameUiShowErrorDialogAsync

# XGameUiShowErrorDialogAsync

針對指定的錯誤碼，顯示含有服務定義之錯誤字串的錯誤對話方塊 UI。

## 語法

```cpp theme={null}
HRESULT XGameUiShowErrorDialogAsync(  
         XAsyncBlock* async,  
         HRESULT errorCode,  
         const char* context  
)  
```

### 參數

*async*   \_In\_<br />類型：[XAsyncBlock\*](/zh-TW/reference/system/xasync/structs/xasyncblock)

傳遞至 [XAsyncRun](/zh-TW/reference/system/xasync/functions/xasyncrun) 之 [XAsyncBlock](/zh-TW/reference/system/xasync/structs/xasyncblock) 的指標。

*errorCode*   \_In\_<br />類型：HRESULT

要為其顯示 UI 的錯誤碼。

*context*   \_In\_opt\_<br />類型：char\*

要針對此錯誤顯示的服務定義錯誤字串。

### 傳回值

類型：HRESULT

非同步呼叫的 HRESULT 成功或錯誤碼。

## 備註

對話方塊上可能會視情況出現其他按鈕，例如供 XBOX Insider 回報錯誤的「回報問題」按鈕。

當使用者關閉錯誤對話方塊時，非同步作業即完成。

呼叫 UI 會導致您的遊戲進入\_受限模式\_。在受限模式下，您的遊戲位於所呼叫 UI 的背景時，將會獲得較少的系統資源。若要深入了解受限模式及遊戲的其他作業模式，請參閱 [XBOX 遊戲生命週期 (NDA 主題)](/zh-TW/build/console-features/console-workflows/xbox-game-life-cycle)。

## 需求

**標頭：** XGameUI.h

**程式庫：** xgameruntime.lib

**支援的平台：** Windows、Steam Deck、XBOX One 系列主機和 XBOX Series 主機

## 另請參閱

[XGameUI](/zh-TW/reference/system/xgameui/xgameui_members)<br />[XGameUIShowErrorDialogResult](/zh-TW/reference/system/xgameui/functions/xgameuishowerrordialogresult)<br />[XBOX 遊戲生命週期 (NDA 主題)](/zh-TW/build/console-features/console-workflows/xbox-game-life-cycle)


## Related topics

- [XGameUiShowErrorDialogAsync](/reference/system/xgameui/functions/xgameuishowerrordialogasync.md)
- [XGameUiShowErrorDialogResult](/reference/system/xgameui/functions/xgameuishowerrordialogresult.md)
