- Messages
- 60
- Country
-
Hello,
I have been struggling with this topic for quite sometime and checking several code to try and find an answer. Also, and although I might misinterpret something, I have read once and again the official documentation (MSFS's, FSX's and P3D).
The question is this simple, and maybe I am doing it right already. But since I am still getting some issues within my code, I'm not sure if these are due to this problem or some other.
This is what I do, from what I've seen:
First I include the proper requestID in my enum structure:
At some point in my code, when I create a SimConnect_AICreateSimulatedObject, I initialize it with the following to release it and be able to move it without issues:
Now, the problem I see from third-party code, is that the REQUEST_PROBE_RELEASE is never called within the Callback function. Is this how its supposed to work?
I am wondering if this is the problem why I am getting a SIMCONNECT_EXCEPTION_DATA_ERROR (20) although the code seems to be working fine.
Thank you.
Best!
I have been struggling with this topic for quite sometime and checking several code to try and find an answer. Also, and although I might misinterpret something, I have read once and again the official documentation (MSFS's, FSX's and P3D).
The question is this simple, and maybe I am doing it right already. But since I am still getting some issues within my code, I'm not sure if these are due to this problem or some other.
This is what I do, from what I've seen:
First I include the proper requestID in my enum structure:
C++:
static enum DATA_REQUEST_ID {
REQUEST_PROBE_RELEASE,
...
}
At some point in my code, when I create a SimConnect_AICreateSimulatedObject, I initialize it with the following to release it and be able to move it without issues:
C++:
void probe_init(int probe_i)
{
HRESULT hr;
hr = SimConnect_AIReleaseControl(hSimConnect, probe_info[probe_i].id, (UINT)REQUEST_PROBE_RELEASE+probe_i);
hr = SimConnect_TransmitClientEvent(hSimConnect,
probe_info[probe_i].id,
EVENT_FREEZE_ALTITUDE,
1,
SIMCONNECT_GROUP_PRIORITY_HIGHEST,
SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);
hr = SimConnect_TransmitClientEvent(hSimConnect,
probe_info[probe_i].id,
EVENT_FREEZE_ATTITUDE,
1,
SIMCONNECT_GROUP_PRIORITY_HIGHEST,
SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);
hr = SimConnect_TransmitClientEvent(hSimConnect,
probe_info[probe_i].id,
EVENT_FREEZE_LATLONG,
1,
SIMCONNECT_GROUP_PRIORITY_HIGHEST,
SIMCONNECT_EVENT_FLAG_GROUPID_IS_PRIORITY);
}
Now, the problem I see from third-party code, is that the REQUEST_PROBE_RELEASE is never called within the Callback function. Is this how its supposed to work?
I am wondering if this is the problem why I am getting a SIMCONNECT_EXCEPTION_DATA_ERROR (20) although the code seems to be working fine.
Thank you.
Best!