SIMCONNECT_ICAO issue in managed code

Hi, I’m accessing SimConnect from C# but there is an issue with the
SIMCONNECT_FACILITY_MINIMAL class witch is passed as an argument to the
OnRecvFacilityMinimalList callback after doing a RequestFacilityData searching
for a VOR (or something else) and there are multiple possible alternatives.
The problem is that the member icao of type SIMCONNECT_ICAO cannot be
accessed from managed code since it has a member of type sbyte
(https://learn.microsoft.com/en-us/dotnet/api/system.sbyte?view=net-7.0)
which is not CLS-compliant. I have created a work around which converts the
whole SIMCONNECT_FACILITY_MINIMAL class to a byte array and then converts it
back to a private class where I have replaced sbyte with a normal
byte. See below code, I have put in a line which tries to access the
SIMCONNECT_ICAO so that you can see how Visual Studio complains about it. The
code cannot be built. By removing that line and using my work around, I’m able
to access the data without issues. Would it be possible to change that type in
the SIMCONNECT_ICAO from sbyte to byte in a future update or is there
another easier/more performant work around?

Hi, There is indeed a problem with SIMCONNECT_ICAO in C# but not the one you
point out. If you look at SimConnect.h, SIMCONNECT_ICAO is marked as a
REFSTRUCT (which means it is ref struct) which in that situation makes it
unusable/hard to use. It should be marked as a simple STRUCT. It will be fixed
on the next SDK update and it will be used in the same way you do in your
code. Best Regards Maxime / Asobo