Results 1 to 4 of 4

Thread: SafeArray From VC to VB via DCOM

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 1999
    Posts
    35

    Post

    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: [email protected]

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

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    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

  3. #3
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926

    Post

    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.

  4. #4

    Thread Starter
    Member
    Join Date
    Oct 1999
    Posts
    35

    Post

    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: [email protected]

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width