Variant in VB6 to a VB.NET

Discussion in 'Microsoft VB .NET' started by John, Jul 26, 2004.

  1. John

    John Guest

    Hi,

    I have an COM object used in my VB.NET project. There's one function return
    the result in Variant type so I have to convert it to object type.

    Dim myValue as object

    myValue = MyCOMobjectFunction

    If I want to get value out of the myValue, I have to do this: myResult =
    MyValue(0)

    How can I convert it to dataset or something in VB.NET type?

    Please help. Thanks
     
    John, Jul 26, 2004
    #1
    1. Advertisements

  2. John

    rawCoder Guest

    Hi John,

    You may try CType or DirectCast.
    Or if the Option Strict is set to Off , then i think you can just use =

    Thank You,
    rawCoder

    "John" <> wrote in message
    news:...
    > Hi,
    >
    > I have an COM object used in my VB.NET project. There's one function

    return
    > the result in Variant type so I have to convert it to object type.
    >
    > Dim myValue as object
    >
    > myValue = MyCOMobjectFunction
    >
    > If I want to get value out of the myValue, I have to do this: myResult =
    > MyValue(0)
    >
    > How can I convert it to dataset or something in VB.NET type?
    >
    > Please help. Thanks
    >
    >
    >
     
    rawCoder, Jul 26, 2004
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jim Johnston

    Problem converting VB6 Variant array to object

    Jim Johnston, Mar 12, 2004, in forum: Microsoft VB .NET
    Replies:
    0
    Views:
    610
    Jim Johnston
    Mar 12, 2004
  2. Michael Moreno

    [Upgrade vb6 COM to .Net] - Problem with Variant and Arrays

    Michael Moreno, Mar 3, 2005, in forum: Microsoft VB .NET
    Replies:
    0
    Views:
    353
    Michael Moreno
    Mar 3, 2005
  3. Douglas Marquardt

    ComInterop: VB6 Com Interface object = VB6 Com object fails

    Douglas Marquardt, Mar 22, 2006, in forum: Microsoft VB .NET
    Replies:
    1
    Views:
    429
    Douglas Marquardt
    Mar 22, 2006
  4. Ruth
    Replies:
    3
    Views:
    364
    Herfried K. Wagner [MVP]
    Aug 18, 2006
  5. SAL
    Replies:
    3
    Views:
    5,307
    Cor Ligthert[MVP]
    Dec 19, 2007
Loading...

Share This Page