
How to invoke methods of contained ActiveX control from ATL Composite Control
You can always QI it for its dual interface... #import is of immense
help here - assign the interface you got from GetDlgControl to
an instance of the wrapper class generated by #import. This means
you need exception handling of course (thus the CRT, so remove
_ATL_MIN_CRT from the release builds)...
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
Quote:
> I wrote composite control that contains Far Point Spread ActiveX control. I
> get events but can't find the way to invoke methods and set properties.
> When I included Spread control in my project, .cpp and .h files were
> generated with IDispatch wrappers for its methods and properties. But I
> can't use them because Spread control was not created through the MFC and
> site wasn't set.
> I can get IDispatch interface for Spread control using GetDlgControl .
> Should I use it to invoke methods through their dispatch ID or there is
> better way to do it?