TChart in ATL Control - How to trap mouse events?
Posted: Thu May 20, 2004 2:23 pm
Hi,
I am currently using an instance of ITChart in an ATL control.
Everything works fine, excepts that mouse events won't get through
TChart and I am not able to trap them in my control.
How can I do that.
I first try to advise ITChart by deriving my ATL control from :
IDispEventImpl<1, ARTCurveViewer, &__uuidof(TeeChart::ITChartEvents), &__uuidof(TeeChart::__TeeChart), 1, 0>
Then I created a sink map:
BEGIN_SINK_MAP(ARTCurveViewer)
SINK_ENTRY_EX(1, __uuidof(TeeChart::ITChartEvents), 19, OnTChartMouseDown)
END_SINK_MAP()
And finally, I used DispEventAdvise(...) with the IUnknown interface
of my ITChart instance to advise it. However, DispEventAdvise always
returns error code -2147220990 (0x80040203), which I could not find
the definition.
Am I doing it the right way. If so, what is going wrong? It not, how is
the right way?
Thank you very much.
I am currently using an instance of ITChart in an ATL control.
Everything works fine, excepts that mouse events won't get through
TChart and I am not able to trap them in my control.
How can I do that.
I first try to advise ITChart by deriving my ATL control from :
IDispEventImpl<1, ARTCurveViewer, &__uuidof(TeeChart::ITChartEvents), &__uuidof(TeeChart::__TeeChart), 1, 0>
Then I created a sink map:
BEGIN_SINK_MAP(ARTCurveViewer)
SINK_ENTRY_EX(1, __uuidof(TeeChart::ITChartEvents), 19, OnTChartMouseDown)
END_SINK_MAP()
And finally, I used DispEventAdvise(...) with the IUnknown interface
of my ITChart instance to advise it. However, DispEventAdvise always
returns error code -2147220990 (0x80040203), which I could not find
the definition.
Am I doing it the right way. If so, what is going wrong? It not, how is
the right way?
Thank you very much.