Using a dll created in .NET in VB6

Hi other time

I created a dll in VB .NET that is gonna be used in an VB6 application, I used the Type Library Exporter to reference it in the VB6 application (the tbl file).

Now i technically can enter to the methods of my dll. The problem comes when I run my VB6 application, in the point of calling every method, sends an error like 'Runtime Error "91": Object Variable or With bolck variable not set' and I dunno why is this happening.

Every suggestions are welcomed

[506 byte] By [JLMontero] at [2008-2-13]
# 1

Can you post relevant parts of your code? Where is the assembly located relative to the application? Have you registered the assembly for COM interop (with Regasm or Visual Studio)?

MattiasSj?gren at 2007-10-8 > top of Msdn Tech,Visual Basic,Visual Basic Interop and Upgrade...
# 2

It may be that your .NET dll isn't found by the VB6 app, especially if you're just running from the VB6 IDE. To simplify things, it may help to just use the Visual Studio support for registering your assembly for VB6 to use. It's definitely the easiest way to get up an running with development. On the Properties page you just need to check the check box "Register for COM Interop."

Here's some more detailed info:

http://support.microsoft.com/?kbid=817248

BryanDougherty at 2007-10-8 > top of Msdn Tech,Visual Basic,Visual Basic Interop and Upgrade...
# 3

Hi, thanks a lot.

The problem is resolved now. One of the things was it wasn't registered and the other I didn't put my class like COM with the System.Runtyme.Interop.

Now I can see my dll in VB6

Thanks

JLMontero at 2007-10-8 > top of Msdn Tech,Visual Basic,Visual Basic Interop and Upgrade...