M
Michael Moreno
Hello,
I have a .Net DLL that I use as a COM Server.
I would like to return a SafeArray of double to a VB 6 client.
I have declared this interface
Public Interface ITest
...
Function RetSafe() As <MarshalAs(UnmanagedType.SafeArray,
SafeArraySubType:=VarEnum.VT_R8)> Double()
End Interface
And have implemented a test code:
Public Function RetSafe() As Double() Implements ITest.RetSafe
Dim v As Double()
Dim i As Int16
ReDim v(10)
For i = 0 To v.Length
v(i) = i
Next
RetSafe = v
End Function
In the client, when I do
Dim v as variant
....
v = Test.RetSafe
I get a big crash.
I could not find a way to return a SafeArray in a function. Any idea
how to do it please?
thanks
I have a .Net DLL that I use as a COM Server.
I would like to return a SafeArray of double to a VB 6 client.
I have declared this interface
Public Interface ITest
...
Function RetSafe() As <MarshalAs(UnmanagedType.SafeArray,
SafeArraySubType:=VarEnum.VT_R8)> Double()
End Interface
And have implemented a test code:
Public Function RetSafe() As Double() Implements ITest.RetSafe
Dim v As Double()
Dim i As Int16
ReDim v(10)
For i = 0 To v.Length
v(i) = i
Next
RetSafe = v
End Function
In the client, when I do
Dim v as variant
....
v = Test.RetSafe
I get a big crash.
I could not find a way to return a SafeArray in a function. Any idea
how to do it please?
thanks