I’m expanding a VB6 application which communicates with small embedded systems to use the serial port (they currently use UDP broadcasts); and thus am trying to emulate UDP packets over serial.
Part of this includes a message length in the header, which is two bytes long.
How can I convert an integer in VB6 to two bytes ( byte(2) ) so that program written in C that picks up the message can cast it to a short integer?
The easiest way is to do this.
You can use this technique to break up other data types into bytes.