I’m a bit confused about the RequestId parameter which has to be passed to several SimConnect functions. Here are two examples from the SDK documentation:
For each call (using managed code), the argument is defined as an enum but if I would use the second definition where it says RequestId has to be unique for each call, I can not cast an integer to System.Enum in C#. Here are the definitions of the two functions:
I think the second definition would be the best now when I have learnt that all calls are put into a queue but since there are two different definitions for this RequestId, I’m very confused .
Actually, both those descriptions are swapped. @Nocturne FYI
In the case of RequestDataOnSimObject, as you can request to receive the data every frame or second using SIMCONNECT_PERIOD, the server will map your RequestID to your last received DefineID.
So in the case of 2 calls with identical RequestID but different DefineID, the second call will overwrite the first one.
We will fix this in the documentation.
Thank you for bringing our attention to this.
Sounds great!! One issue though with having the RequestId defined as a System.Enum in the function prototype, I’m not able to cast an integer to System.Enum using Visual Studio. For example (int)123 wont work nor will 123 as int. Some C# examples below:
Ok, it is doable as a work around even if it is a bit dirty. If you ever in the future do some refactoring of SimConnect, maybe you can consider changing the type .