LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Variant in Active X control

Hi,

I need to use the following ".VGet" ActiveX method:

==========================================================================
Visual Basic
[form.]SPELCom.VGet seqName, objName, propName, result

Delphi
procedure VGet(const Sequence, Object_: WideString; Property_: Smallint;
out Result1: OleVariant; var Result2, Result3, Result4: OleVariant);

Visual C++
void pSPELCom->VGet(LPCTSTR Sequence, LPCTSTR Object, short Property_,
VARIANT* Result1, VARIANT* Result2, VARIANT* Result3, VARIANT* Result4);

Parameters
seqName String expression containing the name of a sequence.
objName String expression containing the name of an object in sequence
seqName.
propName String expression containing the name of the property whose
value you want to retrieve.
result Variant containing property or result value.
==========================================================================

When wired to the ActiveX control the VGet method icon looks like this:

===========================
| >> ActiveX control name |
===========================
| VGet |
---------------------------
| > Sequence > | (String)
---------------------------
| > Object > | (String)
---------------------------
| > Property > | (String)
---------------------------
| > Result > | (Variant)
---------------------------

LabView (v. 5.1) requires both the input and output of the "Result" box to
be wired... I guess that this is because it refers to a Variant pointer,
right?

Two things I cannot understand:

1. The only type allowed by LabView for the parameter sent to Result is
Variant, otherwise the wire is disabled, but if I connect an OleVariant
control there (Wire icon + Right button + create control) I get a "type
mismatch" error.

2. I know that the Variant returned by the method for a particular set of
Sequence, object, property strings is an U16 integer... I am thus using the
"To G Data" LabView function with this type to retreive its value, but I
always get a null value, which is not correct.

Can anyone explain to me how I am suppose to wire/use this method?

Thank you very much,

Michel.
0 Kudos
Message 1 of 1
(2,576 Views)