Interop Forms Toolkit DLL and “Class does not support Automation or does not support expected interface” error

StackOverflow https://stackoverflow.com/questions/3072729

Question

I have a .NET WinForms application that I've converted into a COM dll using the Interop Forms Toolkit 2.1. Thet setup project for the application has both my tlb as well as the Microsoft.InteropFormTools.tlb file set to Register as vsdrpCOM. The prerequisites for the project are to ensure that Windows Installer 3.1, .NET Framework 3.5 SP1, and the Microsoft Interop Forms Redistributable Package 2.0a is installed.

When I run this locally on a Windows XP box with both Visual Studio 2010 and Visual Studio 6 installed, it works fine. However, on this Windows XP machine, I receive an error stating: "Class does not support Automation or does not support expected interface."

Any ideas?

Was it helpful?

Solution

I got it. For those of you that are running into the same, do the following:

  1. Go into Visual Studio 2005, 2008, or 2010 (I used 2010) and build your Interop Form.
  2. Then, go into Visual Basic 6. If your library is not already referrenced, reference the library.
  3. Build your VB6 executable.
  4. Go back into Visual Studio (.NET version) and build only your installer. This way the installer and VB6 both have the same .tlb file

You're good to go. Thanks for the suggestion Kris!

OTHER TIPS

You have RegAsm the assembly (see stackoverflow for more) on the machine you want to install the application on. The assembly should also be in the directory where the VB6 application runs, or installed in the GAC.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top