Solved

Using C# DLL in Visual Basic 6

Posted on 2006-11-20
2
1,869 Views
Last Modified: 2013-11-25
I had created a dll in Visual Basic before and  I am calling this dll from my program.

I ran into some problems with the dll as it is fairly complex and it is almost impossible to debug.

If I use C# just to create the dll instead of VB, can anyone tell me how can I call the DLL created in C# from my original VB program? Would there be any effect on performance as the DLL would be created in a non-VB language?

I cant change my original pogram to C#.

Appreciate any help.

Thanks.

0
Comment
Question by:momer123
  • 2
2 Comments
 
LVL 29

Accepted Solution

by:
Nightman earned 75 total points
ID: 17982283
You can register the C# assembly with COM Interop (just make sure that it has a strong name) - regasm.exe < your assembly name and path> /tlb. You then reference the type library from VB (or late bind - up to you). Under high-volume concurrency, there is a performance overhead for COM Interop, but for lower volumes it should not be all that significant.
0
 
LVL 29

Expert Comment

by:Nightman
ID: 17982302
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now