PDA

Click to See Complete Forum and Search --> : SafeArray From VC to VB via DCOM


Björn
Dec 28th, 1999, 07:26 PM
Hi !

I need the help of a DCOM-expert.
Our DCOM-Server (written with VC) offers a method returning a safearray.

In IDL we've declared the parameter as [in, out] variant*. My vb-call looks like this:

Dim MyObj As ServerObj
Dim r As Variant

MyObj.FillArray r

When I use the function UBound it returns the correct number of elements but all elements are empty allthough the server filled them. I cannot access any element with this:
MsgBox r(1)

Then runtime-err 458 occurs.

If any experienced DCOM-Developer has a clue, please help.


TIA
Björn


------------------
EMAIL: shareware@lycosmail.com

PAGE: <A HREF="http://members.xoom.com/sharetools
" TARGET=_blank>http://members.xoom.com/sharetools
</A>

Clunietp
Dec 29th, 1999, 12:36 AM
Is your FillArray function supposed to return a value, or just modify the parameter. If just modify the parameter, is the parameter being passed by value or by reference?

Just some ideas

Tom

Frans C
Dec 29th, 1999, 12:39 AM
I think there is bad news.
I looked for the error code in the Helpfile and this is the result:

Variable uses a type not supported in Visual Basic (Error 458)


Not every variable that appears in a type library or object library can be used by every programming language. This error has the following cause and solution:

You tried to use a variable defined in a type library or object library that has a data type that isn't supported by Visual Basic.
You can't use a variable of a type not recognized by Visual Basic in a Visual Basic program.

For additional information, select the item in question and press F1.

Björn
Jan 2nd, 2000, 04:03 PM
Hi !

The function just modifies the parameter.

When my DCOM-Server sends a string then my variable r is filled and I can read via
MsgBox for example.
Integers or doubles also work, but this damn safearray does not. UBound gives me the correct number of elements but no element is accessible.

Thanks,
Björn

------------------
EMAIL: shareware@lycosmail.com

PAGE: <A HREF="http://members.xoom.com/sharetools
" TARGET=_blank>http://members.xoom.com/sharetools
</A>