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

# PartyLocalDevice::DestroyChatControl

> Queues an asynchronous operation to destroy a local chat control.

Queues an asynchronous operation to destroy a local chat control.

## Syntax

```cpp theme={null}
PartyError DestroyChatControl(  
    PartyLocalChatControl* localChatControl,  
    void* asyncIdentifier  
)  
```

### Parameters

**`localChatControl`**   [PartyLocalChatControl\*](/services/playfab/multiplayer/networking/reference/classes/PartyLocalChatControl/partylocalchatcontrol)

The local chat control to destroy.

**`asyncIdentifier`**   void\*\
*optional*

An optional, app-defined, pointer-sized context value that can be used to associate the completion state change with this call.

### Return value

PartyError

`c_partyErrorSuccess` if the asynchronous operation to destroy the chat control began, or an error code otherwise. If this method fails, no related state changes will be generated. The human-readable form of the error code can be retrieved via [PartyManager::GetErrorMessage()](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_geterrormessage).

## Remarks

This method queues an asynchronous attempt to destroy a local chat control. A [PartyDestroyChatControlCompletedStateChange](/services/playfab/multiplayer/networking/reference/structs/partydestroychatcontrolcompletedstatechange) will be provided upon completion of the operation, indicating success or failure. Before successful completion of the operation, the local chat control will be disconnected from all networks it was previously connected to (each indicated by a [PartyChatControlLeftNetworkStateChange](/services/playfab/multiplayer/networking/reference/structs/partychatcontrolleftnetworkstatechange)). Memory for the local chat control will remain valid until all state changes referencing the chat control have been returned to [PartyManager::FinishProcessingStateChanges()](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_finishprocessingstatechanges).

## Requirements

**Header:** Party.h

## See also

[PartyLocalDevice](/services/playfab/multiplayer/networking/reference/classes/PartyLocalDevice/partylocaldevice)\
[PartyDestroyChatControlCompletedStateChange](/services/playfab/multiplayer/networking/reference/structs/partydestroychatcontrolcompletedstatechange)\
[PartyChatControlDestroyedStateChange](/services/playfab/multiplayer/networking/reference/structs/partychatcontroldestroyedstatechange)\
[PartyChatControlLeftNetworkStateChange](/services/playfab/multiplayer/networking/reference/structs/partychatcontrolleftnetworkstatechange)


## Related topics

- [PartyDevice::GetChatControls](/services/playfab/multiplayer/networking/reference/classes/PartyDevice/methods/partydevice_getchatcontrols.md)
- [PartyDestroyChatControlCompletedStateChange](/services/playfab/multiplayer/networking/reference/structs/partydestroychatcontrolcompletedstatechange.md)
- [PartyManager::GetChatControls](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_getchatcontrols.md)
- [PartyChatControlDestroyedStateChange](/services/playfab/multiplayer/networking/reference/structs/partychatcontroldestroyedstatechange.md)
- [PlayFab Party Release Notes](/services/playfab/multiplayer/networking/release-notes.md)
