tags:

views:

169

answers:

3

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.

+1  A: 

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.

Pent Ploompuu
can u share an example or some link for it
HotTester
If you have registered the vb 6 dll COM type library then it should be as easy as adding a new reference to the c# project (Project->Add Reference->COM).
Pent Ploompuu
+1  A: 

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.

Marc Gravell
+1  A: 

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.

Rubens Farias