VB 6.0 - How to call /Consume the VB6.0 dll into C#.net

Asked By Ramesh Nalla on 31-Jan-14 07:41 AM
Hi All,

I have a requirement that i need to call the VB6 developed dll in C#.net. how to do it in .net

Any help is really appreciated..!

Thanks & Regards
gssRam
Robbe Morris replied to Ramesh Nalla on 31-Jan-14 07:55 AM
Add the dll as a COM reference to your project in Visual Studio
Ramesh Nalla replied to Robbe Morris on 31-Jan-14 01:40 PM
Hi Robbe,

Thanks for your quick reply..!

I have tried the same by using the below link

http://msdn.microsoft.com/en-us/library/ms973800.aspx

I have taken a windows form application and added the vb6.0 dll reference to it. when running the project i got the below error .

Retrieving the COM class factory for component with CLSID {40E7D191-F9CF-4E09-97E3-A812ACBFDC60} failed due to the following error: 80040154
 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
Any help will be appreciated..!

Thanks
Robbe Morris replied to Ramesh Nalla on 31-Jan-14 08:11 AM
regsvr32.exe "full path to and including your dll"

ex. regsvr32.exe "C:\temp\mydll.dll"

Sounds like the COM dll isn't registered on your machine.