http://www.perlmonks.org?node_id=1011561


in reply to Re^2: calling a function from a dll
in thread calling a function from a dll

what is interesting is that the prefix length is a byte count and not a character count,although BSTR is always Unicode

So to find the end of the string you have to get to the stored length which is stored in the first 2 bytes

the example at : BSTR layout shows the byte count and the terminated nulls,both required by BSTR