Initialize a Full Control in a browser from a Composite Control 
Author Message
 Initialize a Full Control in a browser from a Composite Control

Hello,

I created a full control ActiveX in a browser from a
composite control in another browser by using "Navigate2".
(The ActiveX is embed in the browser)

I want to initialize and assign attributes to this full
control from the composite control. How can I get the
control of this full control ? It seems that it will
create another instance if I use "CoCreateInstance".

Can someone tell me how can I get the control from this
new browser?

Thank you
David



Sat, 30 Apr 2005 10:49:44 GMT  
 Initialize a Full Control in a browser from a Composite Control
Are you saying that your composite control hosts WebBrowser, and you
navigate this browser to a page that creates another control via
<object> tag? First, you need to wait until WebBrowser fires
DocumentComplete event - at this point you know that the HTML page is
processed and the control is instantiated. Get the document object with
IWebBrowser2::get_Document. Now you have two ways to proceed.

You can query the document object for IOleContainer and call
EnumObjects. This gives you all ActiveX controls embedded on a page.
Query each for the interface you know your control implements. Once QI
succeeds, you have found your control.

Or, use DHTML interfaces to get to IHTMLObjectElement corresponding to
your <object> tag. E.g. if you know an ID of your object, you can use
document.all.item("myId"). Once there, use
IHTMLObjectElement::get_object to get the interface to your control.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Quote:
> Hello,

> I created a full control ActiveX in a browser from a
> composite control in another browser by using "Navigate2".
> (The ActiveX is embed in the browser)

> I want to initialize and assign attributes to this full
> control from the composite control. How can I get the
> control of this full control ? It seems that it will
> create another instance if I use "CoCreateInstance".

> Can someone tell me how can I get the control from this
> new browser?

> Thank you
> David



Sat, 30 Apr 2005 23:13:25 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. A composite control calling another composite control in web browser

2. ATL Full Control - mouse activation problems in Composite Control

3. ATL Full Control - mouse activation problems in Composite Control

4. Problem with Composite Control containing a Full Control

5. Full control vs. Composite control

6. Composite control hosted by a composite control.

7. Using Rich Edit Control or ip address control in a composite control

8. ATL composite control problem with IESample browser

9. Full Screen Display ActiveX Control on Web Browser

10. Web Browser Control/Explorer Control/HTML Control

11. Get an Item.ItemIndex of controls other than supporting CommandName inside composite controls

12. How to enumerate every control in a composite Control

 

 
Powered by phpBB® Forum Software