Q: I have an ActiveX control used on the web build under MFC. I want to be able to call a javascript
funtion on the webpage the control is hosted. How do I do this?
A: You can use execScript method of the IHTMLWindow2 interface.
Using GetControlUnknown you retrieve IUnknown interface of the browser object. Then you should do
QueryInterface for IWebBrowser2 interface. Then call IWebBrowser2::get_Doccument to obtain an
IHTMLDocument2 interface pointer and then call IHTMLDocument2::get_parentWindow to obtain a pointer to
the IHTMLWindow2 interface.