XGameInviteRegisterForEvent

Registers a callback for a game invite event.

Syntax

HRESULT XGameInviteRegisterForEvent(  
         XTaskQueueHandle queue,  
         void* context,  
         XGameInviteEventCallback* callback,  
         XTaskQueueRegistrationToken* token  
)  

Parameters

queue   _In_opt_
Type: XTaskQueueHandle

The task queue that dispatches the event callback.

context   _In_opt_
Type: void*

The context we pass to the event callback.

callback   _In_
Type: XGameInviteEventCallback*

The event callback function.

token   _Out_
Type: XTaskQueueRegistrationToken*

A token from the task queue that represents the registration. Use the token to un-register the callback for the game invite event.

Return value

Type: HRESULT

HRESULT success or error code.
For a list of error codes, see Error Codes.

Remarks

Note

This function isn't safe to call on a time-sensitive thread. For more information, see Time-sensitive threads.

The XGameInviteRegisterForEvent function uses an XGameInviteEventCallBack as an argument.

To un-register a callback for a game invite event, call XGameInviteUnregisterForEvent.

For an example of calling this function, see the remarks section of the XGameInviteEventCallback topic.

Requirements

Header: XGameInvite.h

Library: xgameruntime.lib

Supported platforms: Windows, Xbox One family consoles and Xbox Series consoles

See also

XGameInvite

XGameInviteEventCallBack

XGameInviteUnregisterForEvent