RE: AttributeError: '' object has no attribute 'SeriesCollection'

2014-02-13 Thread Stefan Schukat
Hello, the "chartObj" is not a Chart object it is a shape see >> from win32com.client import Dispatch >>> Excel = Dispatch("Excel.Application") >>> WB = Excel.Workbooks.Add() >>> Shape = WB.Sheets[0].Shapes.AddChart() >>> Shap

RE: ctypes:Multiple library access problem

2010-05-06 Thread Stefan Schukat
Massi wrote: > > Hi everyone, > > > > in my script I need to execute multiple separated loading of the same > > dll library, in order to handle the internal variables with different > > threads. > > Consider the followin piece of code: > > > > lib1 = cdll.LoadLibrary("MyLib.dll")) > > lib2 = cdll.L

AW: Python2.6 + win32com crashes with unicode bug

2009-11-02 Thread Stefan Schukat
Hello Gerrit, there is no problem in the file, but in the description of the Visio API. The place where the error occurs is during the definition of the parameters of the corresponding Python methods. The information for the names comes from the typelibrary of visio. Probably there is a non e

RE: pydepend (checking dependencies like jdepend) ?

2008-01-04 Thread Stefan Schukat
: python-list@python.org Subject: Re: pydepend (checking dependencies like jdepend) ? On Jan 4, 1:57 pm, "Stefan Schukat" <[EMAIL PROTECTED]> wrote: > Hi, > > try to look at py2exe. This module scans all dependencies to pack them > into one executable. my intention

RE: pydepend (checking dependencies like jdepend) ?

2008-01-04 Thread Stefan Schukat
Hi, try to look at py2exe. This module scans all dependencies to pack them into one executable. Stefan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bernhard Merkle Sent: Friday, January 04, 2008 1:14 PM To: python-list@python.org Subject: py

RE: win32com problem: more than one instance

2007-08-31 Thread Stefan Schukat
Hello Thomas, excel registers its COM objects with REGCLS_SINGLEUSE that means one COM object is created per process. In Solidworks it seems that that they register with REGCLS_MULTIPLEUSE, which means on process can serve more than one COM object. Hence you have no chance to get multiple insta

RE: [pywin32] - Excel COM problem

2007-02-14 Thread Stefan Schukat
"Characters" is a parameterized property. So you can't call it without a generated wrapper. see inside the wrapper: # Result is of type Characters # The method GetCharacters is actually a property, but must be used as a method to correctly pass the arguments def GetCharacte

RE: PyWin32-winxptheme and py2exe

2006-11-15 Thread Stefan Schukat
You probably need to include the common Control Manifest to supprt themes see in the py2exe\samples\advanced directory for an example how to do it. Stefan > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Andrea Gavana > Sent: Tuesday, Nov

RE: Python opening multiple thread of matlab

2006-11-11 Thread Stefan Schukat
Hello, you just forgot to initialize the COM runtime for the separate thread. try following: def __init__(self,matlab_command): self.matlab_command = matlab_command threading.Thread.__init__(self) def run(self): import pythoncom pythoncom.CoInitiali

RE: python thread state

2006-10-24 Thread Stefan Schukat
For this use case the PyGILState API was introduced. e.g. try PyGILState_STATE state = PyGILState_Ensure() run python code PyGILState_Release(state) Stefan > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Bryan > Sent: Monday, October

RE: Thread termination

2006-10-17 Thread Stefan Schukat
(). However I was able to execute my_ie.Navigate("google.com"). But that was not I wanted. I am not knowing where the error is.... Please let me know the solution ASAP... Teja.P   On 10/13/06, Stefan Schukat <[EMAIL PROTECTED]> wrote: Reading from your last pos

RE: Thread termination

2006-10-13 Thread Stefan Schukat
Reading from your last posts you are using COM objects. Therefore you should not "kill" the thread since this would lead to reference leaks. So there are only two ways left: 1. Program a specific interpreter and not use python.exe which implements an access to PyThreadState_SetAsyncExc 2. Check in

RE: how to use python com server in c++?

2006-08-21 Thread Stefan Schukat
Hello, you have to use the low level API methods for access and then the methods of IDispatch since the win32com gateway only supports late bound calls for dispatch interfaces. e.g. IDispatch* pDisp; CoCreateInstance( ... CLSID_Leelay, , IID_IDispatch, ...&pDisp);

RE: COM Makepy Question

2006-07-07 Thread Stefan Schukat
It seems that the ocx only works in a GUI environment. Perhaps you could try to embed the ocx in a pythonwin dialog which you create invisible since the dialog is then a control container see "Python24\Lib\site-packages\pythonwin\pywin\Demos\ocx\ocxtest.py" Stefan > -Original Messag

RE: embedding Python in COM server loaded with win32com

2006-06-06 Thread Stefan Schukat
Hi, when you are running in Python the PyInitialize() is not called and therefore you don't have a valid threadstate since the call in win32com uses the standard idiom Py_BEGIN_ALLOW_THREADS() CallComServer Py_END_ALLOW_THREADS() You could use PyNewInterpreter to get a valid state, but this w

RE: COM Server crashing when returning large arrays

2006-05-23 Thread Stefan Schukat
Hello Alistair, which version of pythoncom you are using? In the newer versions there is an support for a "native" safearray (the data type Excel is providing). In older versions the complete array was converted to a tuple which is very time and memory consuming. during this conversion you could

RE: Get all attributes of a com object

2006-04-28 Thread Stefan Schukat
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Tim Golden > Sent: Friday, April 28, 2006 11:45 AM > To: python-list@python.org > Subject: RE: Get all attributes of a com object > > [snip] > > The only thing is that you can't always build a prox

RE: Get all attributes of a com object

2006-04-28 Thread Stefan Schukat
Hello, you only get information about a COM object when you have a wrapper. But you are using the dynamic invoke (Dispatch). So try the typelibrary browser in Pythonwin or use the generated wrapper with makepy or gencache.EnsureDispatch. But dir will give you only the methods and internal class

RE: Help needed on COM issue

2006-04-19 Thread Stefan Schukat
Hi, the feature you expierenced are parameterized properties. This is only supported by VB and could only be emulated in python. If you use makepy/gencache to generate a wrapper the appropriate Set methods are created: oR.SetItem(1,2, "4") Stefan > -Original Message- > From:

RE: win32com early binding problem

2006-01-25 Thread Stefan Schukat
win32com does only support late bound interfaces in python scripts. To support early bound interfaces a pyd has to be created. If you want to script early bound interfaces try ctypes.com aka. comtypes from Thomas Heller. Stefan > -Original Message- > From: [EMAIL PROTECTED] > [

RE: Python, COM Servers, and Multi-Threading

2005-11-07 Thread Stefan Schukat
Hi, you get best performance if you make your servers local servers, since then every interpreter runs in ist own process. If you make it an inproc server you synchronize all threads/CPUs with the GIL. Even better multithreading support you will get if you mark your server to run in an multithre

RE: Pythoncom scripting Windows Media Player & visible

2005-08-02 Thread Stefan Schukat
Hello, you have to put the ocx in a container window (e.g. a dialog or the IE). Without this the media player just acts like a normal COM object. Example for the dialog you can find in [Pythonroot]\Lib\site-packages\pythonwin\pywin\Demos\ocx Bye Stefan > -Original

RE: returning list of strings from Python COM to Visual basic 6

2005-07-21 Thread Stefan Schukat
You have to wrap the python object with a COM object: def Get_Obj(self): return win32com.server.util.wrap(an_object) Stefan > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of > Philippe C. Martin > Sent: Thursday, July 21, 2005 1:42 AM

RE: What are com_record objects

2005-05-18 Thread Stefan Schukat
Use the Record Method from win32com.client object = win32com.client.Dispatch("Server.Object") IPAddress = win32com.client.Record("IPADDRESS_STRUCT", object) IPAddress.b1 = 192 IPAddress.b2 = 168 IPAddress.b3 = 0 IPAddress.b4 = 1 object.connect(IPAddress) Stefan > -Original Message-

RE: how to pass an array to a VB array via COM

2005-05-09 Thread Stefan Schukat
A patch is available at sourceforge: https://sourceforge.net/tracker/index.php?func=detail&aid=1195096&group_id=78018&atid=551956. Stefan > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of > jelle > Sent: Friday, April 29, 2005 4:56 PM > To: pyth

RE: how to pass an array to a VB array via COM

2005-04-27 Thread Stefan Schukat
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of > jelle > Sent: Tuesday, April 26, 2005 12:31 PM > To: python-list@python.org > Subject: how to pass an array to a VB array via COM > > > Hi, > > I'm trying to script Rhino -the nurbs modeller, not the

RE: COM connection point

2005-03-18 Thread Stefan Schukat
Just use obj = win32com.client.Dispatch(obj) Stefan > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of > Oy Politics > Sent: Wednesday, March 16, 2005 11:51 PM > To: python-list@python.org > Subject: COM connection point > > > Hello: > > I

RE: keeping a COM server alive

2005-02-17 Thread Stefan Schukat
Hi, there is no real solution if you are using a standard local server. The server is as a COM object reference counted. So if the reference count reaches 0 (no client) it will shutdown itself which is done by design. If you want a different behavior you should write either a service which export

RE: threading and internet explorer com

2005-01-28 Thread Stefan Schukat
... and pythoncom.CoUninitialize() My preferred way is: def run(): pythoncom.CoInitialize() try: ie = win32com.client.Dispatch('InternetExplorer.Application.1') finally: # Trigger the release of the object since after CoUninitialize