Article ID: 112673 - Last Review: December 9, 2003 - Revision: 2.0 How to Pass & Return Unsigned Integers to DLLs from VBThis article was previously published under Q112673 On This PageSUMMARY
Visual Basic stores its integer variables in an 8-bit data field, as
does C. Visual Basic uses signed integers only, so it reserves one of the
bits as a sign bit. In C, you have the choice of an unsigned integer (the
variable ranges from 0 to 65536) or a signed integer (the variable ranges
from -32767 to +32767 as do Visual Basic integer variables).
MORE INFORMATION
Visual Basic stores its integer variables in an 8-bit data field, as
does C. Visual Basic uses signed integers only, so it reserves one of the
bits as a sign bit. In C, you have the choice of an unsigned integer (the
variable ranges from 0 to 65536) or a signed integer (the variable ranges
from -32767 to +32767 as do Visual Basic integer variables).
Step-by-Step ExampleFollow a process similar to the following to pass a value greater than 32767 as an integer from Visual Basic to a dynamic link library (DLL) that is expecting an unsigned integer or to return an integer value that is outside the range of valid Visual Basic integers:
APPLIES TO
| Article Translations
|

Back to the top
