Using a C# Class Library with VB6

  • Thread starter Thread starter lord.torall
  • Start date Start date
L

lord.torall

I hope I'm posting this in the right place....

I have a new C# class library written in Visual Studio 2008. I also
have an existing VB6 application that I have been maintaining for some
time.

In the configuration of the class library I have enabled "Make
assemble COM-Visible" and "Register for COM interop"

When I build the class library on my development machine I am able to
see and reference it from my VB6 application as I do many other dlls.
However, I am having a real headache when it comes to deploying my
application. I usualy build my MSI using InstallShield and have added
the dll and it's associated tlb to the package. However when I attempt
to run the released application on a test machine it fails with an
error 429. If I run the application in debug mode, if breaks the first
time it attempts to reference anything to do with my new class
library.

Can anyone give me some pointers as to what I should be doing in order
to run my application on anything other than my development machine?
 
Have you registered the VB6 runtime and used regasm on the C# class library?
 
I hope I'm posting this in the right place....

I have a new C# class library written in Visual Studio 2008. I also
have an existing VB6 application that I have been maintaining for some
time.

In the configuration of the class library I have enabled "Make
assemble COM-Visible" and "Register for COM interop"

When I build the class library on my development machine I am able to
see and reference it from my VB6 application as I do many other dlls.
However, I am having a real headache when it comes to deploying my
application. I usualy build my MSI using InstallShield and have added
the dll and it's associated tlb to the package. However when I attempt
to run the released application on a test machine it fails with an
error 429. If I run the application in debug mode, if breaks the first
time it attempts to reference anything to do with my new class
library.

Can anyone give me some pointers as to what I should be doing in order
to run my application on anything other than my development machine?

First off, you need to make sure to assign GUIDs correctly on your
class and on your interfaces. Then, you need to make sure to register
your assembly after you've deployed using regasm.exe.

This article should help

http://msdn2.microsoft.com/en-us/library/c3fd4a20.aspx
 
Back
Top