Most APIs were written by C programmers, so most APIs are written specifically for the C language. Because of this, there are many APIs that are completely unusable by VBA, because VBA does not support some of the data types required by these APIs. Of those APIs that are accessible to VBA, most require consideration with regard to the data types used. Use a wrong data type and your computer will quickly let you know all about it.
The following sections describe the C data types often specified for API parameters, the VBA data types that should be used with them, the recommended calling conventions, and, where applicable, the technique that converts signed integer values from unsigned integer values and vice versa.
The first thing to note at this point is that the C language uses something that is unknown to VBA: signed numbers. VBA only uses unsigned numbers. For example, Figure 13-6 shows an 8-bit byte. Notice that having a binary 1 in the most significant bit (the eighth bit) signifies that the number contained within the byte is a negative number. A 0 in the same position indicates that the number is positive.
Although the total number of values that a single byte can hold (employing both positive and negative number ranges) increases, the number of possible positive numbers decreases ...