Error: "The object invoked has disconnected from its clients"

Hi,

When I am trying to doControls.Add("progId") in my VB6 Application it is throwing me Error -2147417848 "The object invoked has disconnected from its clients".

The progId I am using in the function is the ProgID of a COM Visible .Net user control. (That is registered already).

What is the reason for this error? Can some one help me to solve this problem?

Thanks,

Benin.

[450 byte] By [Benin] at [2008-2-15]
# 1
Tricky problem. The way COM memory management works is that it keeps track of how many references are outstanding to a component/class. Not unlike .NET management but in the COM case it is done 'by hand'. Calling IUnknown.AddRef increases the reference count by one, calling IUnknown.Release decreases it by one. When it reaches zero, it's bye-bye time for the object.
Your problem here is that you, somehow, get one too many Release() calls. Finding out why is admittedly very difficult. Automated tools like VB6 or .NET CCW's are pretty good at getting it right. It's your own code, probably, that gets it wrong. Good luck finding out why, it's going to be pretty tuff....
nobugz at 2007-10-8 > top of Msdn Tech,Visual Basic,Visual Basic Interop and Upgrade...