Fog Creek Software
Discussion Board

Welcome! and rules

Joel on Software

Interop problem

I was using a COM control (icclient.ocx from succesfully for several days.  I imported it into the project simply by adding a reference to the OCX.

Today I was testing installing/uninstalling, so the OCX would have got registered/deregistered several times.  Now whenever I go to create an instance by

ICClient = New ICClientLibrary.ICClient

I get the following exception -

An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in interop.icclientlibrary.dll

Additional information: Exception from HRESULT: 0x80040202.

This means nothing to me.  I've done google searches, google groups searches and nothing helped.  I've removed the reference, recreated the reference, unregistered, registered, removed every reference I can find to the control via regedit, everything I can think of.  Nothing works ... 

BUT - If I create a new .NET project and add a reference to the OCX, put a button on a form and create the instance there, it works fine.  WTF?  Any ideas?

Brett O'Callaghan
Thursday, October 07, 2004

More information - this is the stacktrace I get

at System.Runtime.InteropServices.UCOMIConnectionPoint.Advise(Object pUnkSink, Int32& pdwCookie)
  at ICClientLibrary.IICClientEvents_EventProvider.add_OnMessage(IICClientEvents_OnMessageEventHandler )
  at ICClientLibrary.ICClientClass.add_OnMessage(IICClientEvents_OnMessageEventHandler )
  at CS.intercomhandler.set_ICClient(ICClient WithEventsValue)
  at CS.intercomhandler.setUp(Boolean& OK, TreeView NewTree) in C:\WiniDev\CS\commserver\intercomhandler.vb:line 35
  at CS.main.CreateObjects() in C:\WiniDev\CS\commserver\main.vb:line 188
  at CS.main.main() in C:\WiniDev\CS\commserver\main.vb:line 235

Brett O'Callaghan
Thursday, October 07, 2004

A google of the web for 0x80040202 took me to;en-us;183216 ... from reading that I'd guess that dropping the thing on the form did some extra work: perhaps building and/or registering a proxy DLL.

You might find more hints, by googling the web and/or by googling the microsoft.public and/or microsoft.public.dotnet newsgroups.

Christopher Wells
Thursday, October 07, 2004

*  Recent Topics

*  Fog Creek Home