As addition to Jeffs answer.
library is the way to go, but by default the cstruct functions operate on strings and not on binary datatype.
The binary datatype is a bit awkward as a lot of Sal/VT and the cstruct functions can not be used on this datatype.
It is easier to stick with strings.
The second parameter of the Win32 API function
should be defined as
Receive String: LPVOID
So then, when called you will have the data in a string variable.
It also depends on the actual contents of the data. is it text (ANSI, UNICODE) or is it really binary data (image, soundfile etc)?
When it is binary data which probably could contain bytes having value 0 (zero), you are unable to concatenate the data using
These steps should be taken:
1) Calculate the total size in bytes needed for all the pieces put together
2) Create a memory buffer buffer having this size using
3) Copy each part to the memory buffer. The first part will be copied to position 0 in the memory buffer. The second part at the offset given by the size of the first piece. Using
4) When all parts are placed in the buffer, copy all the data back into a local string variable.
When you insist in using binary datatype, you must be aware that you can not use
These functions actually encode the contents of the binary as ANSI/UNICODE which will destroy your data.
To convert between binary and string and visaversa, read this article:
https://wiki.tdcommunity.net/index.php/B ... ng_casting