- Messages
- 78
- Country

I am not a programmer of any type but if something is not available that I would like to use I do try and make it.
I've had lots of help from these forums over the years and I know this one is pretty simple for those that know how, but I don't know how.
I display information from the aircraft I'm flying in Teamspeak.
For instance I display the Squawk with the below code...
I would also like to display the Callsign /Registration of my Aircraft.
I believe I need hr = SimConnect_AddToDataDefinition(hSimConnect, COM_DEFINITION, "ATC ID", "", SIMCONNECT_DATATYPE_STRING32); to get the callsign but I have no idea how to display it as a string (%s).
Would I need to add it as below?
struct _ComData
{
double Callsign;
};
_ComData sCD = { 0., 0. };
double FSAPI Callsign()
{
if (NULL == hSimConnect) return None Set;
else return sCD.Callsign;
}
All help is appreciated.
I've had lots of help from these forums over the years and I know this one is pretty simple for those that know how, but I don't know how.
I display information from the aircraft I'm flying in Teamspeak.
For instance I display the Squawk with the below code...
Code:
char SQUAWK[8];
struct _ComData
{
double Transponder;
};
_ComData sCD = { 0., 0. };
double FSAPI Transponder()
{
if (NULL == hSimConnect) return 0000;
else return sCD.Transponder;
}
void OnRecvOpen(SIMCONNECT_RECV_OPEN *pData, DWORD cbData, void* pContext)
{
hr = SimConnect_AddToDataDefinition(hSimConnect, COM_DEFINITION, "TRANSPONDER CODE:1", "Hz", SIMCONNECT_DATATYPE_FLOAT64);
}
sprintf_s(SQUAWK, "%4.0f", Transponder());
I would also like to display the Callsign /Registration of my Aircraft.
I believe I need hr = SimConnect_AddToDataDefinition(hSimConnect, COM_DEFINITION, "ATC ID", "", SIMCONNECT_DATATYPE_STRING32); to get the callsign but I have no idea how to display it as a string (%s).
Would I need to add it as below?
struct _ComData
{
double Callsign;
};
_ComData sCD = { 0., 0. };
double FSAPI Callsign()
{
if (NULL == hSimConnect) return None Set;
else return sCD.Callsign;
}
All help is appreciated.

