[python-win32] win32, ASP, ActivePython COM Help
Jorgensen, Jens
jens.jorgensen@tallan.com
Mon, 23 Jul 2001 12:07:57 -0500
You should look into your IUSR_XXX. The user IIS runs stuff as has
limited access to the system. Notably, it does not allow access to the
registry. This could be your problem or it could be something else the
software is trying to access. Have you tried this in VBScript? I bet
you'll get the same thing. This most likely is not a python problem.
Jim Abrams wrote:
>I've posted this to c.l.py to no avail, any ideas, however odd, might
>help.
>
>PythonWin 2.1 (#15, Apr 19 2001, 10:28:27) [MSC 32 bit (Intel)] on win32.
>Portions Copyright 1994-2001 Mark Hammond (MarkH@ActiveState.com) - see
>'Help/About PythonWin' for further copyright information.
>
>>>>import win32com.client
>>>>pptc = win32com.client.Dispatch("Powerpoint.Application")
>>>>ppt = pptc.Presentations.Add(WithWindow=0)
>>>>slide = ppt.Slides.Add(1, 12)
>>>>shapes = slide.Shapes
>>>>shapes.AddOLEObject(ClassName=u'ShockwaveFlash.ShockwaveFlash.1')
>>>>
><win32com.gen_py.Microsoft PowerPoint 9.0 Object Library.Shape>
>
>>>>pptc
>>>>
><win32com.gen_py.Microsoft PowerPoint 9.0 Object Library._Application>
>
>>>>ppt
>>>>
><win32com.gen_py.Microsoft PowerPoint 9.0 Object Library.Presentation>
>
>>>>slide
>>>>
><win32com.gen_py.Microsoft PowerPoint 9.0 Object Library.Slide>
>
>>>>shapes
>>>>
><win32com.gen_py.Microsoft PowerPoint 9.0 Object Library.Shapes>
>
>>>>shapes.AddOLEObject
>>>>
><method Shapes.AddOLEObject of Shapes instance at 019D099C>
>
>
>All is cool.
>But, try this same thing inside an ASP page...
>
><%@LANGUAGE="Python"%>
><%
>def w(o):
> Response.Write(Server.HTMLencode(repr(o)) + "<br>")
>
>import win32com.client
>pptc = win32com.client.Dispatch("Powerpoint.Application")
>w(pptc)
>
>ppt = pptc.Presentations.Add(WithWindow=0)
>w(ppt)
>
>slide = ppt.Slides.Add(1, 12)
>w(slide)
>
>shapes = slide.Shapes
>w(shapes)
>
>w(shapes.AddOLEObject)
>
>shapes.AddOLEObject(ClassName=u'ShockwaveFlash.ShockwaveFlash.1')
>w(shape)
>%>
>
>
>gets me:
>
><win32com.gen_py.Microsoft PowerPoint 9.0 Object Library._Application>
><win32com.gen_py.Microsoft PowerPoint 9.0 Object Library.Presentation>
><win32com.gen_py.Microsoft PowerPoint 9.0 Object Library.Slide>
><win32com.gen_py.Microsoft PowerPoint 9.0 Object Library.Shapes>
><method Shapes.AddOLEObject of Shapes instance at 00762B4C>
>
>Python ActiveX Scripting Engine error '80020009'
>
>Traceback (innermost last): File "<Script Block >", line 13, in ?
>shapes.AddOLEObject(ClassName=u'ShockwaveFlash.ShockwaveFlash.1') File "d:
>\python21\win32com\gen_py\91493440-5A91-11CF-8700-00AA0060263Bx0x2x6.py",
>line 4692, in AddOLEObject return self._ApplyTypes_(0x7d8, 1, (9, 32), ((4,
>49), (4, 49), (4, 49), (4, 49), (8, 49), (8, 49), (3, 49), (8, 49), (3, 49),
>(8, 49), (3, 49)), 'AddOLEObject', '{91493479-5A91-11CF-8700-
>00AA0060263B}',Left, Top, Width, Height, ClassName, FileName, DisplayAsIcon,
>IconFileName, IconIndex, IconLabel, Link) File "d:\python21\win32com\client
>\__init__.py", line 334, in _ApplyTypes_ return self._get_good_object_(apply
>(self._oleobj_.InvokeTypes, (dispid, 0, wFlags, retType, argTypes) + args),
>user, resultCLSID) COM Error: Shapes.AddOLEObject : An error occurred during
>creation of an ActiveX Control.
>
>?
>
>return self._get_good_object_(apply(self._oleobj_.InvokeTypes, (dispid, 0,
>wFlags, retType, argTypes) + args), user, resultCLSID
>
>
>Any ideas?
>
>
>_______________________________________________
>Python-win32 mailing list
>Python-win32@python.org
>http://mail.python.org/mailman/listinfo/python-win32
>
--
Jens B. Jorgensen
jens.jorgensen@tallan.com