[python-win32] IActiveScript::AddNamedItem fails with exception

David Manns davidm at pulsonix.com
Wed Apr 4 10:02:11 CEST 2012


Mark,

Tried doing that, but nothing comes out on the debug trace at all. Do I have
to uncomment or add any trace commands in any of the .py files, or should I
expect to see things appear on the console already?
 
Best regards,
David

-----Original Message-----
From: Mark Hammond [mailto:skippy.hammond at gmail.com] 
Sent: 03 April 2012 06:11
To: David Manns
Cc: python-win32 at python.org
Subject: Re: [python-win32] IActiveScript::AddNamedItem fails with exception

On 3/04/2012 1:09 AM, David Manns wrote:
> We have a scripting engine interface in our application. This works 
> fine for loading/calling VBscript and Javascript scripting engines, 
> but PythonScript fails. Specifically, it fails at :
>
>      m_pAxsScript->AddNamedItem("application", SCRIPTITEM_NAMEDITEM)
>
> where m_pAxsScript is the IActiveScript interface acquired through 
> CoCreateInstance. The hresult returned is:
>
>      80004005
>
> which to my mind implies some kind of 'access denied' error. We are 
> using Python 2.7.2 and Pywin32 2.7 on a Windows 7 32-bit system. We 
> have this problem here on a test machine that was set up to match that 
> in use at one of our customers who is now stuck being unable to run 
> any of his Python scripts.
>
> Any clues or suggestions would be gratefully received.
>
> David

I'd suggest you:

* Execute "python win32comext\axscript\client\pyscript.py -debug" - this
will re-register the engine for debugging.

* Execute "python -m win32traceutil" - this will start a process which is
capturing messages from the COM object now it is in debug mode.

* Attempt to create and use the engine - this should cause output to be
generated.

Given the error is E_FAIL and the pyscript engine doesn't specifically throw
that, I suspect you will see a traceback.  Another alternative is to use the
IErrorInfo interfaces (I think that is what they are called) to try and grab
more information at runtime.

Mark




More information about the python-win32 mailing list