I set AcPEXCtl.AcPePropertyEditorEditButton.16 In GetCustomPropertyCtrl,how can I catch click button event.
Thanks.
Hi,
Here are the steps that you might need to follow to get this to work.
This is only based on my understanding of the ATL COM Events and if this does not work, please provide me a sample project to reproduce the problem and I will see if I can help.
Step 1:
Implement a class that implements the "IConnectionPointImpl". As seen from the OleView utility (screenshot attached), the "AcPePropertyEditorEditButton" also implements the "IAcPiPropertyEditEventsSink". So, our class that implements the IConnectionPointImpl will act as a sink and here is a sample code for such a class.
template <class T> class CProxy_IAcPiPropertyEditEventsSink : public IConnectionPointImpl<T, &__uuidof(IAcPiPropertyEditEventsSink), CComDynamicUnkArray> { public: void OnClick() { ::MessageBox(NULL, L"Clicked !!", L"Autodesk", MB_OK); } } ;
Step 2:
Ensure that the COM wrapper class also inherits the events sink created in Step 1.
So you may need to add the following line along with all other classes that it inherits.
<<<
public CProxyIAcPiPropertyEditEventsSink<YourClassName>,
>>>
This should ensure that the new class acts as a events sink.
Hope this helps.