The SimConnect_MapClientDataNameToID function is used to associate an ID with a named client data area.

 

Syntax
HRESULT SimConnect_MapClientDataNameToID(
      HANDLE  hSimConnect,
      const char*  szClientDataName,
      SIMCONNECT_CLIENT_DATA_ID  ClientDataID
      );

 

Parameters
ParameterDescriptionType
hSimConnectHandle to a SimConnect object.Integer
szClientDataNameNull-terminated string containing the client data area name. This is the name that another client will use to specify the data area. The name is not case-sensitive. If the name requested is already in use by another addon, a error will be returned.Integer
ClientDataIDA unique ID for the client data area, specified by the client. If the ID number is already in use, an error will be returned.Integer

 

Return Values

The function returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return valueDescription
S_OKThe function succeeded.
E_FAILThe function failed.
SIMCONNECT_EXCEPTION_ALREADY_CREATEDThe name requested is already in use by another addon.
SIMCONNECT_EXCEPTION_DUPLICATE_IDThe ID number is already in use.

 

Remarks

This function should be called once for each client data area: the client setting up the data should call it just before a call to SimConnect_CreateClientData, and the clients requesting the data should call it before any calls to SimConnect_RequestClientData are made. The name given to a client data area must be unique, however by mapping an ID number to the name, calls to the functions to set and request the data are made more efficient.