ObjectARX

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

How to catch click button event

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

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

Thanks.

ADN Support Specialist
Balaji_Ram
Posts: 662
Registered: ‎03-21-2011
Message 2 of 2 (135 Views)

Re: How to catch click button event

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

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.



Balaji
Developer Technical Services
Autodesk Developer Network

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
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 to get help installing your software.

Ask the Community