Active Member
Posts: 10
Registered: ‎06-01-2009
Message 1 of 2 (172 Views)

How to catch click button event

172 Views, 1 Replies
10-29-2012 07:34 PM

I set AcPEXCtl.AcPePropertyEditorEditButton.16  In GetCustomPropertyCtrl,how can I catch  click button event.


ADN Support Specialist
Posts: 693
Registered: ‎03-21-2011
Message 2 of 2 (140 Views)

Re: How to catch click button event

11-09-2012 09:52 AM in reply to: masterhe3000



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> {


		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.

Developer Technical Services
Autodesk Developer Network

Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.