you could read two single bytes from the file and use a function like:
Public Function MakeWord(msb As Byte, lsb As Byte) As Long
MakeWord = CLng("&h" & Trim$(Hex(msb)) & Trim(Hex(lsb)))
End Function
Function takes two bytes and makes a C++ short integer(word) 16bit
msb;Most significan byte, lsb;least signinficant byte, watch the byte order.
VB does not support Unsigned data type so must return a long
probably not the most efficient inplementation but serves as an example
hope it helps, any probs....
al.
"Salgoud Dell" <sa*****@nomail.com> wrote in message
news:<ca**********@news.cfu.net>...
C++ has a variable type 'unsigned short int.' I am trying to write a VB6
program that prints these out of a file made originally by C++. However,
the unsigned short integer (1-65535) is not supported. Does anyone have a
routine that will allow VB6 to read a C++ unsigned short int?
Thanks
Del