开发者

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

开发者 https://www.devze.com 2023-01-03 19:40 出处:网络
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.InteropFormT

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?


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!


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消