0
votes

I have a Visual Basic DLL, I used it in a Windows User Control Application. It works fine, but when I HOST this Windows User Control in another Windows Forms application, it gives me the following error.

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.

When I run the User Control it works fine with me, ONLY when I host it in another Windows application this error occurs.

  • I'm using Visual Studio 2008 & Windows Server 2003

  • when I add the User Control, the DLL path is "C:\Documents and Settings\USERNAME\My Documents\Visual Studio 2008\Projects\HMS_WF4\HMS_WF4\obj\Release\Interop.DLLNAME.dll"

Notes. it's in Release, but when I compile the application it puts the output in the Debug folder. Even if I select the Release folder for debugging and compilation, when the application is run, it searches for the DLL in the Release folder, but it's in the Debug folder.

1
when i added the VB6 assembly in WINDOWS USER CONTROL , it's name preceded by "Interop" then "NAME.DLL" automatically , but when i add it to the windows application that hosted USER CONTROL , it's name still "NAME.DLL"MuniR

1 Answers

0
votes

I get it....

When I host the User Control in a Windows Forms application, it initialize objects from the User Control objects in Form1.Designer.vb. Like Me.FrmTransactions31.TransHdr = CTransHdrClass2.

I just replaced CTransHdrClass2 with Nothing

Thanks for all.