Re: [python-win32] issues with win32com constants and static/dynamic dispatch

2007-07-04 Thread Simon Dahlbacka
my best guess is that you should be using .ProductName (capital p) as static dispatch is case sensitive.. /S On 7/4/07, Jason Ferrara [EMAIL PROTECTED] wrote: I'm trying to use a COM library from python. If I use dynamic dispatch, the com objects all behave correctly, but the constants

Re: [python-win32] issues with win32com constants and static/dynamic dispatch

2007-07-04 Thread Jason Ferrara
On Jul 4, 2007, at 11:20 AM, Simon Dahlbacka wrote: my best guess is that you should be using .ProductName (capital p) as static dispatch is case sensitive.. /S Thats not it. productName is the correct case. And also.. print c PyIUnknown at 0xac640c with obj at 0xf0d808 dir(c)

[python-win32] Strange/impossible Python COM interface behavior

2007-07-04 Thread Richard Bell
In my continued work on a COM automation interface for IE I've encountered a strange/impossible Python behavior. Here's what appears to be the offending code: - code - nodes = self.DomGetNListFilterValue(node, tags, properties, value,

Re: [python-win32] Strange/impossible Python COM interface behavior

2007-07-04 Thread Richard Bell
A bit more testing revealed that there are two issues, one a bug in my code and the other a potential issue with the python COM code. First, I'd written a routine to flash an IE DOM node and moved it into a class. Unfortunately, I coded it like this in the class: def DomFlash(node,

[python-win32] win32com array handling bug?

2007-07-04 Thread Jason Ferrara
I'm making a COM call that should return a two dimensional array, but instead I get back a buffer that appears to only contain a single row from the array. Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32 Type help, copyright, credits or license for more

Re: [python-win32] issues with win32com constants and static/dynamicdispatch

2007-07-04 Thread Mark Hammond
That is strange - the problem is that the resulting COM object is returning an IUnknown rather than an IDispatch. A work around should be to say: c = cams[0] c = win32com.client.Dispatch(c) or possibly: c = win32com.client.Dispatch(c.QueryInterface(pythoncom.IID_IDispatch)) I think we could

Re: [python-win32] Strange/impossible Python COM interface behavior

2007-07-04 Thread Mark Hammond
from win32com.client import DispatchBaseClass I'm unable to find DispatchBaseClass and so can not chase the issue further Its in win32com.client.__init__.py (never mind that I'm a bit over my head in the Win32Com code). Interestingly, __repr__ is NOT in the GenPY output code, so I assume

Re: [python-win32] win32com array handling bug?

2007-07-04 Thread Mark Hammond
I'm making a COM call that should return a two dimensional array, but instead I get back a buffer that appears to only contain a single row from the array. Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32 Type help, copyright, credits or license for

Re: [python-win32] win32com array handling bug?

2007-07-04 Thread Jason Ferrara
On Jul 4, 2007, at 7:12 PM, Mark Hammond wrote: At this point f should be a 2048 by 1536 array of bytes, but instead... len(f) 2048 type(f) type 'buffer' Arrays of type VT_UI1 are returned as buffers. You should find the length of f is 1536, and you can treat it as a string (ie,

Re: [python-win32] Threading Issue

2007-07-04 Thread Bob Gailer
Following is untested but based on other work I've done: import threading class Foo: def __init__(self): self.list = [] def run(self): # manipulate the list from within the thread foo = Foo() threading.Thread(target = foo.run) ... foo.list # access the list as modified by

[python-win32] Python Magazine - pywin32

2007-07-04 Thread Michael Foord
Hello all, There is a new Python magazine just launching: http://www.pythonmagazine.com They are looking for articles that will appeal to Windows users, so if anyone fancies getting paid to write an article on pywin32 I'm sure they will be interested. Michael Foord