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

# PFLobbyConnectToLobbyCompletedStateChange

> Details of the ConnectToLobbyCompleted PlayFab Multiplayer state change, delivered when a client has finished connecting to a lobby via a connection string.

Information specific to the *ConnectToLobbyCompleted* type of state change.

## Syntax

```cpp theme={null}
struct PFLobbyConnectToLobbyCompletedStateChange : PFLobbyStateChange {  
    HRESULT result;  
    PFEntityKey newMember;  
    const char* lobbyId;  
    void* asyncContext;  
    PFLobbyHandle lobby;  
}  
```

### Members

**`result`**   HRESULT

Indicates the result of the ConnectToLobby operation.

The human-readable form of this result can be retrieved via [PFMultiplayerGetErrorMessage()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/functions/pfmultiplayergeterrormessage).

**`newMember`**   [PFEntityKey](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/pfentitykey_clientsdk)

The entity provided to the call associated with this state change which is connecting to the lobby.

**`lobbyId`**   const char\*\
*is null-terminated*

The lobby ID provided to the call associated with this state change.

**`asyncContext`**   void\*

The async context provided to the call associated with this state change.

**`lobby`**   PFLobbyHandle\
*must not be null*

The lobby that was connected to.

## Requirements

**Header:** PFLobby.h

## See also

[PFLobby members](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/pflobby_members)


## Related topics

- [PFMultiplayerConnectToLobby](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pfmultiplayerconnecttolobby.md)
- [PFLobbyStateChangeType](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/enums/pflobbystatechangetype.md)
- [PFMultiplayer C/C++ API overview - PFLobby.h](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/pflobby_members.md)
- [PFLobbyFindLobbiesCompletedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyfindlobbiescompletedstatechange.md)
- [PFLobbyJoinLobbyCompletedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyjoinlobbycompletedstatechange.md)
