PC Review


Reply
Thread Tools Rate Thread

Variant in VB6 to a VB.NET

 
 
John
Guest
Posts: n/a
 
      26th Jul 2004
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



 
Reply With Quote
 
 
 
 
rawCoder
Guest
Posts: n/a
 
      26th Jul 2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using created variant value to reference to a variant within my code TD Microsoft Excel Programming 1 22nd Apr 2009 11:53 AM
[Upgrade vb6 COM to .Net] - Problem with Variant and Arrays Michael Moreno Microsoft VB .NET 0 3rd Mar 2005 05:45 PM
VB.NET WebService to VB6 COM Object - Variant parameter Kumar Thiagarajan Microsoft Dot NET 0 17th Dec 2004 06:52 PM
Problem converting VB6 Variant array to object Jim Johnston Microsoft VB .NET 0 12th Mar 2004 02:42 AM
COM/VB6 interop: passing integer in variant Lars von Wedel Microsoft C# .NET 4 7th Aug 2003 11:03 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:45 AM.