2011-03-26 70 views
0

我有一個Visual Basic DLL,我在Windows用戶控制應用程序中使用它。它工作正常,當我主持這個Windows用戶控制在另一個Windows窗體應用程序,它給我以下錯誤。在.NET 3.5 Windows應用程序中使用VB DLL錯誤

An error occurred creating the form. See Exception.InnerException for details. The error is: Creating an instance of the COM component with CLSID {66DF4F1A-E3E2-43D3-92BC-D56E9DDCB8AC} from the IClassFactory failed due to the following error: 800a005b.

當我運行了用戶控制它正常工作與我,只有當我在另一個Windows應用程序託管它出現此錯誤。

  • 我使用Visual Studio 2008 & Windows Server 2003的

  • 當我添加了用戶控制,該DLL的路徑爲「C:\的Documents and Settings \用戶名\我的文檔\ Visual Studio 2008中\ Projects \ HMS_WF4 \ HMS_WF4 \ obj \ Release \ Interop.DLLNAME.dll「

注意事項:它在Release中,但是當我編譯應用程序時,它將輸出放在Debug文件夾中。即使我選擇Release文件夾進行調試和編譯,運行應用程序時,它也會在Release文件夾中搜索DLL,但它位於Debug文件夾中。

+0

當我在WINDOWS USER CONTROL中添加VB6程序集時,它的名稱前面是「Interop」,然後是 「NAME.DLL」,但是當我將它添加到託管USER CONTROL的Windows應用程序時,它的名稱仍然是「NAME」。 DLL」 – MuniR 2011-03-26 08:10:55

回答

0

我得到它....

當我在主持一個Windows用戶控件窗體應用程序,它初始化Form1.Designer.vb從用戶控制對象的對象。像Me.FrmTransactions31.TransHdr = CTransHdrClass2

我剛剛更換CTransHdrClass2Nothing

感謝所有。