Hugi
asked on
How to comunicate between zwo ActiveX Controls
I start the IE4 by using IWebBrowser Interface from my Application witch is an ActiveX. The WebBrowser contains an ActiveX Object witch has to communicate with my Application. How can I do that? (Please give me an example)
ASKER
But how can I get the pointer to the moniker on the Object (Parameter i need for calling GetObject)
ASKER
But how can I get the pointer to the moniker on the Object (Parameter i need for calling GetObject)
ASKER
Message to thui: Sorry, I'm a new user of this tool. Your anser was not bad but I need an example, how to implement. Maybe it was wrong to open the question for other users...
The following content is from
ActiveX SDK FAQ
Frequently Asked Questions on Developing with the ActiveX SDK
Last updated: October 16, 1996
How do I access IE's object model from a contained control?
IE supports an Automation interface called IWebBrowserApp. It also supports an object model for scripting through a hierarchy of interfaces, the root of which is IHTMLDocument. The IHTMLDocument interface has one property, Script, which returns the dispinterface for the IOmWindow interface. This corresponds to the window object described in the ActiveX SDK documentation. From a contained control or doc object, you can get the dispinterface for IWebBrowserApp with the following code:
IOleClientSite* pClientSite; // already points to the control's client site
IServiceProvider* pISP;
IDispatch* pIEIDisp;
pClientSite->QueryInterfac e(IID_ISer viceProvid er, (void **)&pISP);
pISP->QueryService(IID_IWe bBrowserAp p, IID_IDispatch, (void **)&pIEIDisp);
To get the dispinterface for IHTMLDocument, given that you already have the ISP pointer as above, you can use this code:
IDispatch* pScriptIEDisp;
pISP->QueryService(SID_SCo ntainerDis patch, IID_IDispatch, (void**)&pScriptIEDisp);
ActiveX SDK FAQ
Frequently Asked Questions on Developing with the ActiveX SDK
Last updated: October 16, 1996
How do I access IE's object model from a contained control?
IE supports an Automation interface called IWebBrowserApp. It also supports an object model for scripting through a hierarchy of interfaces, the root of which is IHTMLDocument. The IHTMLDocument interface has one property, Script, which returns the dispinterface for the IOmWindow interface. This corresponds to the window object described in the ActiveX SDK documentation. From a contained control or doc object, you can get the dispinterface for IWebBrowserApp with the following code:
IOleClientSite* pClientSite; // already points to the control's client site
IServiceProvider* pISP;
IDispatch* pIEIDisp;
pClientSite->QueryInterfac
pISP->QueryService(IID_IWe
To get the dispinterface for IHTMLDocument, given that you already have the ISP pointer as above, you can use this code:
IDispatch* pScriptIEDisp;
pISP->QueryService(SID_SCo
Also,
INFO: Accessing the Object Model from Within an ActiveX Control
http://support.microsoft.com/support/kb/articles/q172/7/63.asp
http://support.microsoft.com/support/activexsdk/faq/ieobjmodel.asp
INFO: Accessing the Object Model from Within an ActiveX Control
http://support.microsoft.com/support/kb/articles/q172/7/63.asp
http://support.microsoft.com/support/activexsdk/faq/ieobjmodel.asp
ASKER
I think, the anser of thui was better, but I don't know how to implement.
ASKER
Question specification: I need informations about using the IRunningObjectTable (Register, GetObject and how to get the pointer to the Moniker)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
One you have the interface, you can query it for any other interfaces you have defined for that communication.