FIX: Enumerating Connection Points Causes GP Fault (131102)
The information in this article applies to:
This article was previously published under Q131102 SYMPTOMS
Attempting to enumerate connection points with the IEnumConnectionPoints
interface results in a general protection (GP) fault. Specifically,
attempting to call the IEnumConnectionPoints::Next() method cause a GP
Fault.
CAUSE
The problem occurs in the CEnumConnPoints::OnNext() function located in the
CDK source file CTLCONN.CPP.
BOOL CEnumConnPoints::OnNext(void FAR* pv)
{
if (!CEnumArray::OnNext(pv))
return FALSE;
// outgoing connection point needs to be AddRef'ed
// (the caller has responsibility to release it)
((LPCONNECTIONPOINT)pv)->AddRef();
return TRUE;
}
AddRef() is called through an improperly dereferenced pointer. The line of
code should be this:
(*(LPCONNECTIONPOINT*)pv)->AddRef();
RESOLUTION
Currently, there is no workaround for this problem. Avoid enumerating
connection points. You can also retrieve connection points with the
IConnectionPointContainer::FindConnectionPointFromIID() function.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This problem has been fixed in Visual C++
version 5.0.
Modification Type: | Minor | Last Reviewed: | 8/16/2005 |
---|
Keywords: | kbbug kbCtrl kbfix kbLocalSvr kbNoUpdate kbVC500fix KB131102 |
---|
|