> I am developing an ActiveX control that is going to be used with
> LabView. How do you access an LabView Array from within the ActiveX
> control? Or how can you get LabView to access memory that has been
> allocated in the ActiveX control.
>
> I have never programmed in LabView, it is a coworker that handles that
> side. Or general coversation is something like this:
>
> He: "The input to your function is an int16 array. Please fill it with
> something"
> Me: "Ahh, ok, you mean a pointer to an int16 array."
> He: "No, no. An ARRAY."
> Me: "A handle to an array!?!?"
> He: "No, no. Just an array."
>
> Is there anyone out there that has experience of both sides? How should
> the ActiveX interface be declared? Can't LabView handle pointers and
> handles?
>
The LabVIEW
array implementation is pretty opaque; so your coworker doesn't
know the details because he doesn't have to know them in order to use them.
LV arrays are stored in handles, but that isn't what will be passed to your
ActiveX Server. Since the communication between LV and the server will be
through an automation interface, the data will arrive at the server in a
safe array. Your server can expand the safe array, and upon returning to
LV, the safe array contents will be copied back into the LV array handle
and propogated down the wire to the next diagram object.
Using a DLL or CIN, it is possible to get access to the LV handle resize it,
copy in new elements, etc. It is also possible for LV to pass in a pointer
to read from as if it were a C array. Automation servers may be in
process, out of process, or on other computers; so the automation interface
has a limited number of datatypes that can be communicated with. If your
server would always be in process, or if you were to implem
ent your own
marshaller, you could expand it to support other datatypes, but LV doesn't
currently support custom interfaces, only Automation interfaces.
Greg McKaskle