Thanx, but you mistook my meanings.
(1)I wrote ActiveX.
(2)The ActiveX will be embed in a html page.
(3)The ActiveX want to know the container html document's IDispatch pointer.
Your solution can only create a new document, and then control it.
Thanx again
angel
"Waldemar Osuch" <os****@ecn.ab.ca>
??????:c5**************************@posting.google .com...
"angel" <da*******@yahoo.com> wrote in message
news:<c7***********@news.f.de.plusline.net>...
Hi
I want to write an ActiveX by using python. And I know how do, but I
don't know how python to access DHTML Document.If using cpp, it can be done by
following source.
/****/
CComPtr<IOleContainer> spContainer;
m_spClientSite->GetContainer(&spContainer);
CComQIPtr<IHTMLDocument2, &IID_IHTMLDocument2> spDoc(spContainer);
if (spDoc)
spDoc->put_bgColor(CComBSTR(_T("pink")));
/****/
Who can tell me how to do the same in python? Thanx
ps. I use win32com package.
Thanx again
angel
Assuming you want to have HTML Document within IE following should
work from the command line.
from win32com.client import Dispatch
ie = Dispatch("InternetExplorer.Application")
ie.Visible = True
ie.Navigate('about:blank')
doc = ie.Document
doc.bgColor = "pink"
I would also recommend running Tools->COM Makepy utility from Pythowin
on Microsoft Internet Controls (for Internet Explorer)
and Microsoft HTML Object Library (for DHTML Document)
waldek