Solved

Using C# DLL in Visual Basic 6

Posted on 2006-11-20
2
1,870 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
JSON Response and request in VB6 application 11 250
How can i Install a new Data Source on Visual Studio 2 94
What is MicroStrategy.NET? 2 58
vb6 connector to SQL Server 2 34
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

896 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

16 Experts available now in Live!

Get 1:1 Help Now