Re:VB activeX problem
I am sorry, it was not very clear.
What I am trying to do is to develop an active X control with vb that has
methods that have arrays as parameters (integer and double arrays or
whatever).
So that is what I did with VB :
Public Function GetArrays(tab5 As Variant, tab6 As Variant) As Integer
Dim i As Integer
For i = 0 To 9
tab5(i) = val5(i)
tab6(i) = val6(i)
Next i
GetArrays = 0
End Function
Public Function SetArrays(tab5 As Variant, tab6 As Variant) As Integer
Dim i As Integer
For i = 0 To 9
val5(i) = tab5(i)
val6(i) = tab6(i)
Next i
SetArrays = 0
End Function
I know that I can use properties but I did it and it only works for one
array. I need to be able to have several arrays as arguments.
The Delphi code is the following :
oaa : OleVariant;
obb : OleVariant;
occ : smallint;
// here some code that initializes the oaa and obb variants to respectively
smallint array and double arrays
occ := tttt.SetArrays(oaa,obb);
this line is supposed to give the values of the arrays val5 and val6 to oaa
and obb.
and the error goes in the TLB.pas file :
function Tt.SetArrays(var tab5, tab6: OleVariant): Smallint;
var
i : string;
begin
CreateControl;
Result := FIntf.SetArrays(tab5, tab6); <----here "Incorrect property value"
end;
In C++ I succeed in doing this because I use the COleSafeArray and its
methods.
Thank you for trying to help me
d