views:

160

answers:

1

Hello, The scenario: I have a TabCtrl in which I plan to place 1 ActiveX Control (myActXCtrl) in each Tab. The number of Tabs can increase dynamically. Hence, I have to create a new instance of ActiveX Control (myActXCtrl) each time and place it in the newly created Tab (I have done till this point successfully).

The problem: The ActiveX Control has some events using which it can notify me of the Clicks or selections made inside(on) the ActiveX Control. For this I need to have Event Sink in the control container to handle the events that are coming from ActiveX Control. (For a design time created ActiveX Control this works fine)

How do I HANDLE the events that are fired by the dynamically created ActiveX Controls?

[I know I cannot define Event Sinks for dynamically created ActiveX Contols]

Thanks in advance for your help!

+1  A: 

you can query the ActiveX for IConnectionPointContiner interface and hook events via IConnectionPoint

Sheng Jiang 蒋晟