Com interop

J

JimM

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
 
D

Dot Net Team [MSFT]

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/default.asp?url=/library/en-us/cpguide/htm
l/cpconmarshalingdatawithcominterop.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconmarshalingdatawithcominterop.asp

Did this give you the info you needed?


--------------------
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top