# SimConnect_RetrieveString The **SimConnect\_RetrieveString** function is used to assist in retrieving variable length strings from a structure.   ##### Syntax ``` cpp HRESULT SimConnect_RetrieveString( SIMCONNECT_RECV* pData, DWORD cbData, void* pStringV, char** ppszString, DWORD* pcbString ); ```   ##### Parameters {{< table-wrapper >}} | Parameter | Description | Type | |--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------| | *pData* | Pointer to a SIMCONNECT\_RECV structure, containing the data. | Pointer | | *cbData* | The size of the structure that inherits the SIMCONNECT\_RECV structure, in bytes. | Integer | | *pStringV* | Pointer to a the start of the variable length string within the structure. | Pointer | | *ppszString* | Specifies a pointer to a pointer to a character buffer that should be large enough to contain the maximum length of string that might be returned. On return this buffer should contain the retrieved string. | Pointer | | *pcbString* | Pointer to a DWORD. On return this contains the length of the string in bytes. | Pointer | {{< /table-wrapper >}}   ##### Return Values The function returns an **HRESULT**. Possible values include, but are not limited to, those in the following table. {{< table-wrapper >}} | Return value | Description | |--------------|-------------------------| | S\_OK | The function succeeded. | | E\_FAIL | The function failed. | {{< /table-wrapper >}}   ##### Example ``` cpp struct StructVS { char title[1]; } StructVS *pS = (StructVS*)&pObjData->dwData; char *pszTitle; DWORD cbTitle; hr = SimConnect_RetrieveString(pData, cbData, &pS->strings, &pszTitle, &cbTitle))) ```   ##### Remarks This function does not communicate with the SimConnect server, but is a helper function to assist in the handling of variable length strings. Its counterpart is the [SimConnect\_InsertString](simconnect-insertstring/) function. Note that this function works in the case where an empty string is in the structure returned by the server.