ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to catch click button event

1 REPLY 1
Reply
Message 1 of 2
masterhe3000
417 Views, 1 Reply

How to catch click button event

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

Thanks.

1 REPLY 1
Message 2 of 2
Balaji_Ram
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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost