Simple Active X

71 views
Skip to first unread message

bkelly

unread,
May 17, 2012, 10:39:24 PM5/17/12
to IADS
Can anyone provide source code for a simple, very simple, ActiveX
control that can be used in IADS for a blob. We would like to see
something that just provides the ability to drop a blob on it. Then
we can use the debugger to check the contents of the blob. The
ActiveX does not have to do anything with the data, just accept it.
If it does do something with it, that's ok.

Just in case it might matter, the blob contains pixels to put in a
custom display.

We prefer C++ and Visual Studio but will take anything we can get.
Thanks for your time

James Bretz

unread,
May 17, 2012, 11:54:48 PM5/17/12
to IADS
The sample project "Creating an ActiveX display using C++ VS2005"
(http://iads.symvionics.com/programs.html) contains an object
"SampleEveryDataPoint". It handles blobs.

Put a break in the function "ProcessBlobData" and drop a blob parameter on
the display.

We just add that example and uploaded it couple of weeks ago, so make sure
you get the latest version,
Jim

--------------------------------------------------
From: "bkelly" <goo...@bkelly.ws>
Sent: Thursday, May 17, 2012 7:39 PM
To: "IADS" <ia...@googlegroups.com>
Subject: [IADS] Simple Active X
> --
> You received this message because you are subscribed to the Google Groups
> "IADS" group.
> To post to this group, send email to ia...@googlegroups.com.
> To unsubscribe from this group, send email to
> iads+uns...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/iads?hl=en.
>

Sherman, Paul

unread,
May 18, 2012, 1:51:25 PM5/18/12
to ia...@googlegroups.com
I'm almost there. I've encorporated the class additions and functions, that
were in your SampleEveryDataPoint code, into my ActiveX app. In debugging,
the value of "numValuesReturned" == 1 in PrepareOutput, so it goes on past the
(numValuesReturned <= 0) into Step 7. At this point the example code loses me.
What I need to process the blob of video data is a pointer to a character string that
I can loop through quickly and assign to my video memory. Then, I will go away for
a long time. Promise.

- Thanks,
Paul

James Bretz

unread,
May 18, 2012, 2:20:39 PM5/18/12
to ia...@googlegroups.com
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

Sherman, Paul

unread,
May 21, 2012, 3:29:04 PM5/21/12
to ia...@googlegroups.com
I'm still trying to read the blob of video data but I've got a question. Byran Kelly
gave me a file that is suppose to contain video data in blob form. The problem is
that I'm getting some pretty weird numbers for the numValuesReturned. I'll get a
1, then a 2 and then 207. I suspect that the file has a problem. What is the format
(header, time, data format) of a .iadsData file with blob data in it. I don't feel that its
worth trying to debug the code until I know that the data is correct.

James Bretz

unread,
May 21, 2012, 3:41:11 PM5/21/12
to ia...@googlegroups.com
Hi Paul,

Those numbers are to be expected, especially if you are stopping the display
in the debugger. If you run without stopping, the number of points will
probably be small. If you stop for any amount of time, your next continue
and break should show a larger value. The longer you pause, the more points
are 'building up'. Does that make sense?

Another possibility is that the data is 'aperiodic'. If it doesn't have a
specific sample rate (I.e. sample rate = 0) then the flow of points could be
erratic. You can examine the file in the DataFileViewer and look at the
header info. It will tell you if it's aperiodic or not. Also, you can
examine the contents of the file. If they are incorrect, the view should be
confused as well.

Once you get the pixel data, try plotting it to the screen. You'll be able
to tell if the internal content of the data is corrupt soon after this step,
Jim

--------------------------------------------------
From: "Sherman, Paul" <pshe...@smartronix.com>
Sent: Monday, May 21, 2012 12:29 PM
To: <ia...@googlegroups.com>
Subject: [IADS] .iadsData file question

Sherman, Paul

unread,
May 21, 2012, 4:14:38 PM5/21/12
to ia...@googlegroups.com
I can't debug the code until I know if the data is right. Another reason that I'm curious
about the format of the .iadsData file is because the size of the file that Byran gave me
is 5,400,896 bytes. Each blob is 1,390 bytes. This leaves either an extra 1112 bytes,
if I right about the 1024 byte header, or 746 bytes if the header is smaller.

________________________________

James Bretz

unread,
May 21, 2012, 4:32:19 PM5/21/12
to ia...@googlegroups.com
This is the point we call "stochastic programming" lol.

You need to find a pattern in the data that makes sense. My suggestion is to
use the DataFileViewer and examine the raw byte values
(Start->Iads->DataFileViewer). I'm guessing that blobs contain some header
information (scan line number, length, etc). If that's so, you should be
able to see that information at the front of each blob (or some constant
offset). If there is a sequence counter, try and see if you can detect that
counter in it's expected location for each blob, and track it's value (make
sure it's incrementing by one etc). This will give you some confidence that
the data is correct.

The good part is that you can contact the person who created the data. This
usually isn't the case and we basically have to reverse engineer the
information, which sometimes takes months or more.

Yes, the file header is 1024 bytes, but I wouldn't let the extra data stop
you. In theory, the last blob could be short. Again, try the data file
viewer,
Jim

--------------------------------------------------
From: "Sherman, Paul" <pshe...@smartronix.com>
Sent: Monday, May 21, 2012 1:14 PM
Reply all
Reply to author
Forward
0 new messages