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


HRESULT SimConnect_MapClientDataNameToID(
      HANDLE  hSimConnect,
      const char*  szClientDataName,


Parameter Description Type
hSimConnect Handle to a SimConnect object. Integer
szClientDataName Null-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
ClientDataID A 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 value Description
S_OK The function succeeded.
E_FAIL The function failed.
SIMCONNECT_EXCEPTION_ALREADY_CREATED The name requested is already in use by another addon.
SIMCONNECT_EXCEPTION_DUPLICATE_ID The ID number is already in use.



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.


See Also