Solved

Using C# DLL in Visual Basic 6

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 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