> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XGameInviteRegisterForEvent (preterido)

> XGameInviteRegisterForEvent (preterido)

# XGameInviteRegisterForEvent (preterido)

> [!NOTE]
>
> Esta API agora está preterida. Use [XGameActivationRegisterForEvent](https://docs.xbox.com/pt-BR/reference/system/xgameactivation/functions/xgameactivationregisterforevent.md) em vez disso.

Registra um retorno de chamada para um evento de convite de jogo.

## Sintaxe

```cpp theme={null}
HRESULT XGameInviteRegisterForEvent(  
         XTaskQueueHandle queue,  
         void* context,  
         XGameInviteEventCallback* callback,  
         XTaskQueueRegistrationToken* token  
)  
```

### Parâmetros

*queue*   \_In\_opt\_\
Tipo: XTaskQueueHandle

A fila de tarefas que despacha o retorno de chamada do evento.

*context*   \_In\_opt\_\
Tipo: void\*

O contexto que passamos para o retorno de chamada do evento.

*callback*   \_In\_\
Tipo: XGameInviteEventCallback\*

A função de retorno de chamada do evento.

*token*   \_Out\_\
Tipo: [XTaskQueueRegistrationToken\*](https://docs.xbox.com/pt-BR/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken.md)

Um token da fila de tarefas que representa o registro. Use o token para cancelar o registro do retorno de chamada para o evento de convite de jogo.

### Valor retornado

Tipo: HRESULT

Código de êxito ou de erro HRESULT.\
Para obter uma lista de códigos de erro, consulte [Códigos de erro](https://docs.xbox.com/pt-BR/reference/errorcodes.md).

## Comentários

> [!NOTE]
>
> Não é seguro chamar esta função em um thread sensível ao tempo. Para obter mais informações, consulte [Threads sensíveis ao tempo](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads).

A função **XGameInviteRegisterForEvent** usa um [XGameInviteEventCallBack](https://docs.xbox.com/pt-BR/reference/system/xgameinvite/functions/xgameinviteeventcallback.md) como argumento.

Para cancelar o registro de um retorno de chamada para um evento de convite de jogo, chame [XGameInviteUnregisterForEvent](https://docs.xbox.com/pt-BR/reference/system/xgameinvite/functions/xgameinviteunregisterforevent.md).

Para obter um exemplo de como chamar esta função, consulte a seção de comentários do tópico [XGameInviteEventCallback](https://docs.xbox.com/pt-BR/reference/system/xgameinvite/functions/xgameinviteeventcallback.md#ID_XGameInviteEventCallback_Remarks).

## Requisitos

**Cabeçalho:** XGameInvite.h

**Biblioteca:** xgameruntime.lib

**Plataformas compatíveis:** Windows, consoles da família XBOX One e consoles XBOX Series

## Documentação conceitual

* [Threads sensíveis ao tempo](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## Confira também

[XGameInvite](https://docs.xbox.com/pt-BR/reference/system/xgameinvite/xgameinvite_members.md)

[XGameInviteEventCallBack](https://docs.xbox.com/pt-BR/reference/system/xgameinvite/functions/xgameinviteeventcallback.md)

[XGameInviteUnregisterForEvent](https://docs.xbox.com/pt-BR/reference/system/xgameinvite/functions/xgameinviteunregisterforevent.md)


## Related topics

- [XGameInviteEventCallback (preterido)](https://docs.xbox.com/pt-BR/reference/system/xgameinvite/functions/xgameinviteeventcallback.md)
- [XGameInviteUnregisterForEvent (preterido)](https://docs.xbox.com/pt-BR/reference/system/xgameinvite/functions/xgameinviteunregisterforevent.md)
- [XGameInvite (preterido)](https://docs.xbox.com/pt-BR/reference/system/xgameinvite/xgameinvite_members.md)
- [XGameProtocolUnregisterForActivation (preterido)](https://docs.xbox.com/pt-BR/reference/system/xgameprotocol/functions/xgameprotocolunregisterforactivation.md)
- [Migrando do MPSD para o PlayFab Multiplayer e o MPA](https://docs.xbox.com/pt-BR/services/xbox-services/multiplayer/mpsd/concepts/live-mpsd-to-mlp.md)
