Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using a VB6 Class in C#

Is it possible to use a VB6 class in C#?

like image 683
James Jeffery Avatar asked Feb 13 '10 14:02

James Jeffery


1 Answers

I think you should just be able to add the library that contains your VB6 type as a reference in your C# project. Visual Studio will create an Interop Assembly on the fly, and you'll get access to all of the types in the VB6 library via Runtime Callable Wrappers.

The tool that creates the Interop Assembly is TLBIMP.EXE, and you can run this yourself if you want more control over the process, eg. if you want to create a Primary Interop Assembly that might be shared by multiple managed components.

like image 112
lesscode Avatar answered Oct 31 '22 10:10

lesscode