HotTester
HotTester

Reputation: 5788

How to use a dll made in vb 6 to c#.net 3.5 application?

How to use a dll made in vb 6 to c#.net 3.5 application ? Although we have interop feature but it requires to map all the functions of the dll. Is there any other way around that is quick and reliable. Further is there any tool that might convert this vb 6 dll to .net assembly ? Thanks in advance.

Upvotes: 2

Views: 913

Answers (3)

Rubens Farias
Rubens Farias

Reputation: 57996

Another "quick and reliable" way, if it's a registered COM+ component, you could just to right-click your .net project, click Add Reference... and to choose your component under COM tab.

Upvotes: 1

Marc Gravell
Marc Gravell

Reputation: 1064044

You mention conversion; have you tried creating it as a VB.NET assembly? If the code isn't too complex (and doesn't rely on things like COM+) you may well be able to migrate it to VB.NET without too much bother. Obviously that won't magically refactor the code to use full OO idioms, but it may be close enough to get it to compile, and then you can reference the dll from your C# (or other .NET language) code.

Upvotes: 1

Pent Ploompuu
Pent Ploompuu

Reputation: 5414

In addition to pinvoke interop (calling functions by name from a dll) .net has excellent COM interop also and it should be relatively easy to expose the vb 6 dll functionality as a COM component.

Upvotes: 1

Related Questions