Cannot add a reference of a dll developed in C# into VB 6.0

  • Thread starter Thread starter Vivek Sharma
  • Start date Start date
V

Vivek Sharma

Hi People,

I have been trying to add a reference of a dll created in C# to VB 6.0. It
just does not accept it. Any ideas.

Thanks
Vivek
 
You have to turn it into a COM object first.

Have a look at this link on CodeGuru :

http://www.codeguru.com/vb/gen/vb_general/miscellaneous/article.php/c8269/


Also make sure that you change the assembly version number to a fixed
number...

Initially it is something like
[assembly: AssemblyVersion("0.0.*")]

On each build the build number is increased and then you have to
reselect the new Dll reference from within VB.

Change the version to
[assembly: AssemblyVersion("0.0.1")]

and this problem will be gone.


Jamie
 
Hi Vivek,

Register for COM Interop

In the solution explorer, right on your solution and choose properties.

Under the configuration properties --> Build

set the Register for COM Interop from false to true...

Then you are ready to use in VB6.

Have fun.

Cheers.

Regards,
Chua Wen Ching
visit us at http://www.necoders.com
 
Thanks. I tried building the project it gives me an error...

COM Interop registration failed. Type library exporter can not load required
library MSCOREE.TLB

Please help
 
Back
Top