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

# PFLobbyGetConnectionString

> PFLobbyGetConnectionString reference for retrieving the default connection string used to join a PlayFab lobby via the PlayFab Multiplayer C++ SDK.

Gets the default connection string associated with the lobby.

## Syntax

```cpp theme={null}
HRESULT PFLobbyGetConnectionString(  
    PFLobbyHandle lobby,  
    const char** connectionString  
)  
```

### Parameters

**`lobby`**   PFLobbyHandle

The handle of the lobby.

**`connectionString`**   char\*\*\
*library-allocated output*

The output connection string.

### Return value

Type: HRESULT

`S_OK` if the call succeeded or an error code otherwise. The human-readable form of the error code can be retrieved via [PFMultiplayerGetErrorMessage()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/functions/pfmultiplayergeterrormessage).

## Remarks

If this lobby object was created by calling [PFMultiplayerCreateAndJoinLobby()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pfmultiplayercreateandjoinlobby), this method will return an error until [PFMultiplayerStartProcessingLobbyStateChanges()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pfmultiplayerstartprocessinglobbystatechanges) provides a successful [PFLobbyCreateAndJoinLobbyCompletedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbycreateandjoinlobbycompletedstatechange). <br /><br /> If this lobby object was created by calling [PFMultiplayerCreateAndClaimServerLobby()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pfmultiplayercreateandclaimserverlobby), this method will return an error until [PFMultiplayerStartProcessingLobbyStateChanges()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pfmultiplayerstartprocessinglobbystatechanges) provides a successful [PFLobbyCreateAndClaimServerLobbyCompletedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbycreateandclaimserverlobbycompletedstatechange).   <br /><br /> If this lobby object was created by calling [PFMultiplayerClaimServerLobby()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pfmultiplayerclaimserverlobby), this method will return an error until [PFMultiplayerStartProcessingLobbyStateChanges()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pfmultiplayerstartprocessinglobbystatechanges) provides a successful [PFLobbyClaimServerLobbyCompletedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyclaimserverlobbycompletedstatechange).   <br /><br /> If this lobby object was created by calling [PFMultiplayerJoinLobby()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pfmultiplayerjoinlobby), this method will return an error until [PFMultiplayerStartProcessingLobbyStateChanges()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pfmultiplayerstartprocessinglobbystatechanges) provides a successful [PFLobbyJoinLobbyCompletedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyjoinlobbycompletedstatechange).

## Requirements

**Header:** PFLobby.h

## See also

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


## Related topics

- [Integration with PlayFab Lobby & Match](/services/xbox-services/multiplayer/mpa/concepts/live-mpa-playfab-integration.md)
- [Moving from MPSD to PlayFab Multiplayer and MPA](/services/xbox-services/multiplayer/mpsd/concepts/live-mpsd-to-mlp.md)
- [PFMultiplayer C/C++ API overview - PFLobby.h](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/pflobby_members.md)
- [Lobby.ConnectionString](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/Lobby/ConnectionString.md)
- [LobbySearchResult.ConnectionString](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/LobbySearchResult/ConnectionString.md)
