Hi.
I have a page that is hosted by a WebBrowser control that is "hosted"
by a WinForms.
The page displays an ActiveX control.
I need, from C# code to access and manipulate the ActiveX control. I
already managed to get a reference to the HTMLObjectElementClass
object, but I need to somehow get the right reference to the ActiveX
object itself so that I will be able to invoke directly it's methods,
like:
myActiveX.Load();
To be more specific. Let's say we have this HTML page:
Code:
<html><BODY><table><tr><td><object classid=clsid: 464623dc-4d81-11dc-8314-0800200c9a66 id='myControl' width='660', height='500'><PARAM NAME='Host' VALUE='192.168.3.100'/>
<PARAM NAME='HttpPort' VALUE='80'/>
<PARAM NAME='RTSPPort' VALUE='554'/>
<PARAM NAME='RTSPoverHTTP' VALUE='0'/>
<PARAM NAME='RTSPoverTCP' VALUE='0'/>
<PARAM NAME='VFormat' VALUE='96'/>
<PARAM NAME='G72640PT' VALUE='98'/>
<PARAM NAME='G72632PT' VALUE='97'/>
<PARAM NAME='G72624PT' VALUE='99'/>
<PARAM NAME='G72616P' VALUE='100'/>
<PARAM NAME='AMRPT' VALUE='101'/>
<PARAM NAME='UIMode' VALUE='0'/>
<PARAM NAME='MediaUsername' VALUE='z'/>
<PARAM NAME='MediaPassword' VALUE='z'/>
</object>
</td>
</tr>
</table>
</body>
</html>
I get a reference to the hmtl element like this:
Code:
HTMLDocumentClass doc = webBrowser1.Document.DomDocument as mshtml.HTMLDocumentClass;
HTMLObjectElementClass myControl = doc.all.item("myControl", 0) as HTMLObjectElementClass;
From myControl I need to get a reference to the underlying COM object
with the appropriate type so that I can call methods like this:
Code:
myControlCOM.Load();
Thanks.