views:

231

answers:

2

I have an ATL/COM project, in VC++ 6. I want an existing class, that has never before been defined to raise events, to raise events. To do this, the class will have to implement a "connection point".

These events are of a type that no class has ever raised before, so I will have to create a new connection point, rather than reuse an existing one.

I know how to make a class implement a connection point - right click the class in Class View, select "implement connection point", and select the appropriate connection point from the list it displays.

I know how to make a new connection point, as long as it is associated with a new ATL class to implement it - check "Support Connection Points" when creating the class.

But I can't figure out how to create a new connection point without creating a new ATL class that implements it.

I've modified the IDL to include something similar to the existing connection points' definitions:

[
 uuid(*blah blah blah*),
 helpstring("_IBlahEvents Interface")
]
dispinterface _IBlahEvents
{
 properties:
 methods:
 [id(1), helpstring("method BlahChanged")] HRESULT BlahChanged();
};

(Obviously I have a real uuid, not "blah blah blah").

After doing this, the _IBlahEvents interface shows up in Class View. But when I right click on the ATL class that I want to implement _IBlahEvents, and select "Implement Connection Point", _IBlahEvents doesn't show up in the list of existing connection points.

I've recompiled, including cleaning and rebuilding all.

What am I missing?

Thanks.

A: 

Do you have this base class added?

  public IConnectionPointContainerImpl<CYOUR_CLASS_HERE>

If that's not it, create a new project from scratch that matches this one except check the checkbox "Support Connection Points".

Make sure to use the same names. Then, diff that against the original project to see what is missing.

Lou Franco
A: 

If you've modified manually the IDL file - then you should do this step manually too. That is - in the coclass add the following :

[default, source] dispinterface _IBlahEvents;
da_m_n