Hi,

I copied your example exactly and I had the same problem; however,
I am using BeOpen Python 2.0 with the win32all extensions from ActiveState
installed as a separate package (win32all.exe, build 135). When I tried
to run createDocumentFromUrl I get a dialog window: 'python.exe - Application Error,
...The memory could not be "read" ' The Visual C++ debugger shows an 
"Unhandled exception in python.exe (MSHTML.DLL): 0xC0000005: Access Violation". 
Note that the the context is "MSHTML! 700cd41a()". I have IE 5.50.4134.0600.
I'm not sure if all that helps. Maybe something is screwy with MSHTML.DLL.

The following is what I typed (Note: the output does look slightly different):

        C:\Python20\win32com\client>python
        Python 2.0 (#8, Oct 16 2000, 17:27:58) [MSC 32 bit (Intel)] on win32
        Type "copyright", "credits" or "license" for more information.
        >>> import win32com.client
        >>> o = win32com.client.Dispatch('htmlfile')
        >>> o
        <COMObject htmlfile>
        >>> o.createDocumentFromUrl
        <method CDispatch.createDocumentFromUrl of CDispatch instance at 007DE2BC>
        >>> doc = o.createDocumentFromUrl ('192.168.1.1', None)
        
I hope this gives you some more clues.
Yours,
Noah

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Dave
Seidel
Sent: Thursday, January 18, 2001 3:42 AM
To: [EMAIL PROTECTED]
Subject: pythoncom and mshtml


I'm trying to use mshtml (i.e., the Microsoft HTML parser used in IE) from a
Python client, but as this is my first foray into using Python with COM (or on
Win32 for that matter), I'm having some difficulty.  I started by using makepy
on mshtml.tlb to create a wrapper.

Here's a transcript from within the shell:

>>> import win32com.client
>>> o = win32com.client.Dispatch('htmlfile')
>>> o
<win32com.gen_py.Microsoft HTML Object Library.DispHTMLDocument>

This looks OK so far, AFAIK.  Now, the next step is to open a document.  The
python seems to recognize the method:

>>> o.createDocumentFromUrl
<method DispHTMLDocument.createDocumentFromUrl of DispHTMLDocument instance at
01F10EDC>

But when I try to actually use the method:

doc = o.createDocumentFromUrl('192.168.1.1', None)

a fault occurs inside mshtml.dll that kills pythonwin.  If I do this inside a
.py file and wrap it in a 'try', it still kills pythonwin (or python, if I'm at
a prompt). 

Am I doing something wrong?

I'm using ActivePython build 202 on Win98 (4.10.2222).  Any help would be
appreciated.

-- 
Dave Seidel
[EMAIL PROTECTED]


_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activepython

_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activepython

Reply via email to