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<IOleCon tainer> spContainer;
m_spClientSite->GetContainer(& spContainer);
CComQIPtr<IHTML Document2, &IID_IHTMLDocum ent2> spDoc(spContain er);
if (spDoc)
spDoc->put_bgColor(CC omBSTR(_T("pink ")));
/****/
Who can tell me how to do the same in python? Thanx
ps. I use win32com package.
Thanx again
angel 4 2575
"angel" <da*******@yaho o.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<IOleCon tainer> spContainer; m_spClientSite->GetContainer(& spContainer); CComQIPtr<IHTML Document2, &IID_IHTMLDocum ent2> spDoc(spContain er); if (spDoc) spDoc->put_bgColor(CC omBSTR(_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("Inter netExplorer.App lication") ie.Visible = True ie.Navigate('ab out: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
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.g oogle.com... "angel" <da*******@yaho o.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<IOleCon tainer> spContainer; m_spClientSite->GetContainer(& spContainer); CComQIPtr<IHTML Document2, &IID_IHTMLDocum ent2> spDoc(spContain er); if (spDoc) spDoc->put_bgColor(CC omBSTR(_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("Inter netExplorer.App lication") ie.Visible = True ie.Navigate('ab out: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
angel wrote: 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<IOleCon tainer> spContainer; m_spClientSite->GetContainer(& spContainer); CComQIPtr<IHTML Document2, &IID_IHTMLDocum ent2> spDoc(spContain er); if (spDoc) spDoc->put_bgColor(CC omBSTR(_T("pink "))); /****/ Who can tell me how to do the same in python? Thanx
IOleContainer isn't supported by win32com. Let me know if you are
interested in helping add it (it is very hard to add new interface
support correctly without a usecase)
In the meantime, try and find an IDispatch based way of doing it.
Mark.
Hi everyone
Thank you for your reply.
The use case is:
1) I wrote a com server(progid is PythonCom.Test) in Python. It works well.
2) The com server expose some method func1 func2 ...
3) In a html I wrote a jscript
var com = new ActiveXObject(" PythonCom.Test" );
com.func1(); // it's ok
com.func2(); //it's ok too.
4)Now I want my com server can access the html document directly.
I hope my com server can call
document.all.id 1.innerText ="Hello world!"
I know the key is to get the html document's IDispatch. but how to do? I
have tried let a jscript call:
com.func3(docum ent);
but the page report error.
Thanx again.
angel This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Filip Wtterwulghe |
last post by:
Hello,
We have a number of VB6 ActiveX applicationmodule(s) that are loaded
into a IE6 WebBrowserControl . This WebControl is imbededded into
Application X . Now We want to send a message from Application X to all
the ActiveX applicationmodules that are in IEWebbrowser .
Contains Contains
Application X ------------> IE WebControl -------------> Vb6 ActiveX A
Contains
|
by: Rune Strand |
last post by:
What would it take to create a Firefox extension that enables Python as
a script language in the browser - just like Javascript? Is it at all
possible? Are the hundred good reasons not to bother?
I once made an application that used MozPython. It was fun and very
fast compared to the Mod_Python I eventually replaced it with. I had
to, because of all the mess updating Mozilla caused. ActiveState has a
project too . But none of these can...
|
by: marc |
last post by:
I think, it's very simple to do, but i don't know how ?!
i've got a html page which contains :
<div id="myDiv">
<hr />
<hr />
<hr />
<hr />
</div>
|
by: A.M. |
last post by:
Hi at all,
how can I do to insert into a HTML page a file .txt stored in the same
directory of the server where is the html file that must display the text
file.txt?
Thank you very much
P.Pietro
|
by: Jon Davis |
last post by:
I recently learned how to do an <OBJECT> alternative to <IFRAME> in current
browsers using:
<object id="extendedhtml" type="text/html" data="otherpage.html" width="250"
height="400"></object>
My question is how do I access the document DOM of this object in
Javascript? For example, "alert(extendedhtml.innerHTML);" doesn't work and
produces an unknown error. I'd like to both read and write to the document's
body element's innerHTML...
| |
by: Kenneth McDonald |
last post by:
Is there any emerging consensus on the "best" UI for toolkit. Tk
never quite made it but from what I can see, both qt and wxWin are
both doing fairly well in general. I'm already aware of the licensing
issues surrounding qt (fwiw, I think their license fee for commercial
use is eminently reasonable), so aside from that, I was wondering if
there was any feedback readers could provide on the following:
1) Which plays best with Python?...
|
by: Tony Meier |
last post by:
I am using the WebBrowser control (Explorer.Shell.2) from within a VBA
application, embedded on an MS Access form to display the contents of a
local folder. By default on Windows 2000/XP the control displays the
"Common Tasks" section on the left-hand side of the display - I assume it
just shows/hides this based upon the Windows user's settings. Is there any
way to change this to "Classic View", ie to remove the left-side "Common
Tasks"...
|
by: Shawn |
last post by:
Hi.
I've never created an ActiveX control before, so I know little about what it
is capable of and what its limitations are. My problem is this: I have to
create a way to send multiple documents from the web server to a printer on
the user's network. The way it works today the user has to manually
download each document and send it to his printer, but now they want me to
create an automated process.
Will I be able to download documents...
|
by: mikez |
last post by:
Hi,
We recently built a very basic file management system for a client in
Access 2003 (to use with incoming tif scans). In it we used
Microsoft's Document Imaging activex viewer (from Office 2003). The
viewer seems to be a bit 'buggy', in that sometimes if you preview a
tif image using the activex on a form, then goto another form, and then
come back to preview the same image again on the first form, the
preview no longer shows up...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |