Hi Paul,
After step 27, you are pulling the values from the "SafeArray". It's a bit
confusing, but it's basically a fun new array that contains the element type
and dimensions (one of Microsoft's inventions and standard to these types of
interfaces). You can get more background here:
http://msdn.microsoft.com/en-us/library/aa912064.aspx.
A blob type in "SafeArray speak" is simply an array of bytes (as you noted),
but in this example with StartFrameRead/GetNextFrameRead you are actually
getting "N" blobs returned in one array... essentially all the blobs that
are available from the last time you've processed to the current time. So if
you have numValuesReturned = 1, you are getting one array of bytes (1
blob).. if 2, then 2 arrays, etc. Technically, what you are getting in that
initial array is "an array of VARIANTS" (VT_ARRAY|VT_VARIANT) and each
element of this array is "an array of bytes" (VT_ARRAY|VT_I1). Yes, a bit
confusing.
Probably the easiest way to figure it out is to simply copy the example's
function "ProcessBlobData" into your code, and then call that function right
after the "if ( numValuseReturned <= 0 ) return S_OK;" code. Basically,
remove steps 29 and 30 code and just call ProcessBlobData(
numValuesReturned ). Put a breakpoint on that function call, step in and
just look at what each line is doing. When you get to the code that declares
the "BYTE* data" variable, you're done. This is your "array of bytes" that
you need. You can remove the code below that and just process the data
through that variable (the 'data' variable).
Jim
--------------------------------------------------
From: "Sherman, Paul" <
pshe...@smartronix.com>
Sent: Friday, May 18, 2012 10:51 AM
To: <
ia...@googlegroups.com>
Subject: [IADS] Blob into Active X