PC Review


Reply
 
 
JimM
Guest
Posts: n/a
 
      20th Mar 2005
what do I need to use in vb.net to create an object as I do in vb6:

Dim o as Object

Set o = CreateObject("Class1.Test")


Thanks


 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      20th Mar 2005
"JimM" <(E-Mail Removed)> schrieb:
> what do I need to use in vb.net to create an object as I do in vb6:


<URL:http://msdn.microsoft.com/library/en-us/cpguide/html/cpconexposingnetframeworkcomponentstocom.asp>
<URL:http://msdn.microsoft.com/library/en-us/vbcn7/html/vaconCOMInteroperability.asp>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

 
Reply With Quote
 
Dot Net Team [MSFT]
Guest
Posts: n/a
 
      21st Mar 2005
Briefly this is very straightforward if you use the Visual Studio IDE: you
only need to follow a couple of steps -
1. Set a reference to the VB6 Com component.
2. Use the COM class as you would any VB.NET class. (dim x as new
ComClass)

What's happening behind the IDE is that VB.NET creates a class that wraps
the COM class in a .Net class. This work well for most situations, but you
can run into some limitation if the COM class uses variants or strings.

Here's some references with specific examples.
http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconmarshalingdatawithcominterop.asp
http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconmarshalingdatawithcominterop.asp

Did this give you the info you needed?


--------------------
>From: "JimM" <(E-Mail Removed)>
>Subject: Com interop
>Date: Sat, 19 Mar 2005 17:58:33 -0800
>Lines: 10
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
>X-RFC2646: Format=Flowed; Original
>Message-ID: <(E-Mail Removed)>
>Newsgroups: microsoft.public.dotnet.languages.vb
>NNTP-Posting-Host: adsl-67-117-145-73.dsl.snfc21.pacbell.net 67.117.145.73
>Path:

TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP1
2.phx.gbl
>Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.languages.vb:266275
>X-Tomcat-NG: microsoft.public.dotnet.languages.vb
>
>what do I need to use in vb.net to create an object as I do in vb6:
>
>Dim o as Object
>
>Set o = CreateObject("Class1.Test")
>
>
>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
Interop.CDO uses Interop.ADODB which has a higher version... muriwai Microsoft C# .NET 7 27th Oct 2011 08:00 PM
Interop Ira Davis Microsoft Dot NET 1 29th Oct 2008 09:46 PM
Using .NET 1.1 via interop from .Net 2.0 schaf Microsoft C# .NET 0 9th Jun 2008 12:07 PM
Is there a published COM Interop Wrapper for Interop.MSDASC.dll? Burton G. Wilkins Microsoft ADO .NET 0 10th Nov 2003 01:57 AM
COM Interop Abhi Microsoft C# .NET 1 25th Sep 2003 08:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:23 PM.