Questions on COM Objects scripting

Maan Hamze mmhamze at pleiades.net
Mon Sep 3 19:38:14 CEST 2001


I have couple of questions regarding client scripting against COM objects
using Pythonwin, and using Python in an ActiveScripting setting.  All I need
are hints to direct me in the right direction.
1.   Using PythonWin-
I am controlling a povray modeller program (Breeze Designer) that has a COM
interface in the form of:
"Breeze.Scene"

import win32com.client
scene=win32com.client.Dispatch("Breeze.Scene")
#  This all works fine.  Now we continue with
from win32com.client import pythoncom
scene1=pythoncom.Connect("Breeze.Scene")
# I get the following error"
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
com_error: (-2147221021, 'Operation unavailable', None, None)

Taking into account that the very same thing works fine with something like
"Excel.Application"; what does this error tell me about "Breeze.Scene"?

2.  Using Python ActiveScripting
>From inside the applicatio itself (Breeze Designer) there is a facility to
run Macros with languages with ActiveScripting capabilities including
Python.
"Breeze.Scene" is created automatically when Breeze is started.
a macro starts with $Scripting_Language

So
$Python
Breeze.Scene.New()

give me a Python error that Breeze is not defined.  So does Scene.New().
I just can not get Python to communicate with this interface.
If I use
$Python
import win32com.client
scene = win32com.client.Dispatch("Breeze.Scene")

The application is crashing with an error in Pythoncom21.dll

Breeze allows by default for VBScript to get the object without further
trouble.
The question:
I do not know if this is a problem with Breeze OR the way I am doing to get
the object to be used with Python.  maybe:  import win32com.client is not
the way.
If this is not a problem with Breeze, what can we use to communicate with
this object so that Python can be used with it?
Thanks,
Maan







More information about the Python-list mailing list