Okay, I'm trying to manually process a field full of binary data, and I'm
trying to figure out if there's a better way than the fairly obvious "hard way".
Field data is stored in a Variant Array of Bytes as follows:
JunkData(0 to 17)
LengthOfEntry1(18 to 21) 'Little-Endian Long Value
Entry1(22 to whatever)
LengthOfEntry2(x to x + 3) 'Little-Endian Long Value
Entry2(x + 4 to whatever)
(If anybody's curious, this is the PR_REPORT_TAG field a message is tagged
with by Exchange Server when read receipts are requested. There seem to
only ever be two entries, and they SHOULD always be 46 and 16 bytes
respectively in a pure Exchange Server environment, as far as I can tell,
but since specs just don't seem to be out there, I'd like to actually read
in the length values and parse them properly.)
What I need out of this is each Entry field returned as a continuous string
of characters. So if LengthOfEntry1 = 3 and Entry1 was (AB CD EF), then I
would get "ABCDEF" as my first entry string.
I can easily write the code to slog through this "the hard way" and do
LengthOfEntry = b1 + b2 * 256 + ..., Loop over LengthOfEntry bytes
converting each to Hex and appending it to a string. I'm just wondering if
there's a better way to do this that's straight-forward. I'd prefer to
avoid RtlMoveMemory and similar API calls, but it's not entirely out of the
question, as I can certainly see the how it would make things easier.
Rob
Archived from group: microsoft>public>vb>general>discussion