PDA

View Full Version : Data type "BOOL" in SimConnectSDK is 4 bytes of size?


Manuel Ambulo
20 Oct 2006, 11:09
Hi,

This maybe is a FOOL or basic question that i think i shouldnt ask, but just to be sure or confirm.

In the SimConnect SDK, when a variable is type "BOOL" (In the SimVariables list) means it is an "integer" (4 bytes of size), or a "char" (1 byte of size)..of size?...:confused: ...as you know it will return a value of TRUE = 1 or FALSE = 0...

Im asking because i want to be sure if a "BOOL" is "integer" (4 bytes)..or "char" (1 byte).

In C, there is a data type of "BOOL" which is an "integer" (4 bytes of size)...but in C++, there is another data type which is "bool" (not the same as "BOOL"), which is actually (1 byte of size)....

Also i want to ask, data types, BCO16 and BCD32 are like these?:

BCO16 = unsigned short?
BCD32 = unsigned long?

(Correct me if....im wrong)..

Thanks,

Manuel Ambulo

(Sorry for these FOOL questions, but i feel i had to ask them.. to be sure or to confirm, if im wrong then correct me, please) :o

Pete Dowson
20 Oct 2006, 14:26
In the SimConnect SDK, when a variable is type "BOOL" (In the SimVariables list) means it is an "integer" (4 bytes of size), or a "char" (1 byte of size)..of size?...:confused: ...as you know it will return a value of TRUE = 1 or FALSE = 0...

Im asking because i want to be sure if a "BOOL" is "integer" (4 bytes)..or "char" (1 byte).

Types like BOOL are #defined. If you are using Visual Studio, all you need to do is right click on them and select "go to definition" and it will leap to the header where it is defined -- you would see it is a 32-bit value.

In C, there is a data type of "BOOL" which is an "integer" (4 bytes of size)...but in C++, there is another data type which is "bool" (not the same as "BOOL"), which is actually (1 byte of size)....

Depends on which version and which compiler. In Microsoft C++, the C++ predefined type "bool" was also defined as a 32-bit int before version 5.0. I expect this is why library based interfaces are careful to used independently #defined types.

Also i want to ask, data types, BCO16 and BCD32 are like these?:

BCO16 = unsigned short?
BCD32 = unsigned long?


Yes, probably. I've not right-clicked on them and selected "go to definition" to look (I recommend you do, just to be sure), but certainly all FS-defined types in the past have used that type of naming, with the number of bits at the end. as in "FLOAT32" and "FLOAT64", "UINT16, "UINT32" etc.

The Panel SDK gauges header file has good entertainment value in this area, it'll keep you amused for hours! ;-)

Best regards

Pete

Manuel Ambulo
20 Oct 2006, 14:39
THANKS A LOT!, Pete, those questions or doubts kept me thinking for a while... i openned the GAUGES.h file (in the FSX SDK)....after reading your reply... and saw most of the data types described in the SimConnect SDK inside of it with the "#define" statement... :)

Thanks, a LOT,

Best Regards,

Manuel Ambulo