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

# PartyChatControl::SetCustomContext

> 設定與此聊天控制項物件相關聯的選用自訂指標大小內容值。

設定與此聊天控制項物件相關聯的選用自訂指標大小內容值。

## 語法

```cpp theme={null}
PartyError SetCustomContext(  
    void* customContext  
)  
```

### 參數

**`customContext`**   void\*\
*選用*

要與聊天控制項物件一起儲存的任意指標大小值。

### 傳回值

PartyError

`c_partyErrorSuccess` (如果設定自訂內容成功)，否則為錯誤碼。可透過 [PartyManager::GetErrorMessage()](/zh-TW/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_geterrormessage) 擷取錯誤碼的人類可讀形式。

## 備註

自訂內容通常用作「捷徑」，可簡化存取與聊天控制項相關聯的本機遊戲專屬記憶體，而不需要進行對應查閱。可使用 [GetCustomContext()](/zh-TW/services/playfab/multiplayer/networking/reference/classes/PartyChatControl/methods/partychatcontrol_getcustomcontext) 方法擷取此值。 <br /><br /> 程式庫會將任何設定的值視為不透明，且只在本機裝置上有效；該值不會透過網路傳輸。

## 需求

**標頭：** Party.h

## 另請參閱

[PartyChatControl](/zh-TW/services/playfab/multiplayer/networking/reference/classes/PartyChatControl/partychatcontrol)\
[PartyChatControl::GetCustomContext](/zh-TW/services/playfab/multiplayer/networking/reference/classes/PartyChatControl/methods/partychatcontrol_getcustomcontext)


## Related topics

- [PartyChatControl::GetCustomContext](/zh-TW/services/playfab/multiplayer/networking/reference/classes/PartyChatControl/methods/partychatcontrol_getcustomcontext.md)
- [PartyXblChatUser::SetCustomContext](/zh-TW/services/playfab/multiplayer/networking/xblreference/classes/PartyXblChatUser/methods/partyxblchatuser_setcustomcontext.md)
- [PartyDevice::SetCustomContext](/zh-TW/services/playfab/multiplayer/networking/reference/classes/PartyDevice/methods/partydevice_setcustomcontext.md)
- [PartyInvitation::SetCustomContext](/zh-TW/services/playfab/multiplayer/networking/reference/classes/PartyInvitation/methods/partyinvitation_setcustomcontext.md)
- [PartyEndpoint::SetCustomContext](/zh-TW/services/playfab/multiplayer/networking/reference/classes/PartyEndpoint/methods/partyendpoint_setcustomcontext.md)
