It works wonderfully, provided your .NET classes follow a couple rules:

* Public Default constructors
* Static methods can't be called from VB
* Overloaded methods can't be called from VB (well one can, but VB won't
recognize the overload)
* Be careful of variable types (Long in VB is an Int32 in .NET, etc).

Other than that, I haven't had to do anything spectacular with .NET classes
in VB. I actually am nearly finished turning an entire VB  dll into a
wrapper for a .NET assembly (didn't want to deal w/ interop on the .NET
side, the VB dll pretty much sucked anyway). There were only a couple steps
involved:

1 - Build your .NET assembly
2 - RegAsm your .NET assembly
3 - If you want, use TlbExp on your .NET assembly to get intellisense to
work. Unfortunately, I've never been able to export anything more than the
class names, so I don't bother with this step.
4 - In your VB dll, just CreateObject("YourNamespace.YourClass") to
instantiate the class, and then perform method calls on it like you normally
would. Since I skip step 3, I declare my variables as Objects, which I'm
sure is a performance hit, but whatever.

That's it. To debug, simply turn your project properties Debugging mode to
Project, and then manually attach to the process you are debugging. It's
really not too hard. One other thing I do is NGEN the assemblies on the
target computer so that the VB code doesn't have to wait very long to get
the objects.

Adam..

-----Original Message-----
From: franklin gray [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 11, 2002 5:08 PM
To: [EMAIL PROTECTED]
Subject: [DOTNET] Com to DotNet


I think this topic has already been discussed but the archives seem really
slow today.

I have an app written in vb 6.0 that our customers use.  Can we make a
change to a vb 6 com dll to call a VB.net dll?  If so, how hard is it?  Do I
use interop?

What we are trying to do is have our existing app call a webservice.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to