[python-win32] Newbie question
Tim Roberts
timr at probo.com
Sat Sep 23 03:06:23 CEST 2006
Mark C. Brighton wrote:
>Hello, I don't really have experience using win32com and I'm running into a problem. I'm trying to use a COM object. Several of the functions take strings as arguments, but when I pass in a string I get an exception:
>
>
>
>>>>import win32com.client
>>>>o=win32com.client.gencache.EnsureDispatch("AT91Boot_DLL.AT91BootDLL.1")
>>>>o.AT91Boot_Open("/usb/ARM0")
>>>>
>>>>
>Traceback (most recent call last):
> File "<interactive input>", line 1, in ?
> File "C:\Python24\lib\site-packages\win32com\gen_py\A3983AFB-180A-4751-B69B-D5496C253EF2x0x1x0.py", line 52, in AT91Boot_Open
> , h_handle)
> File "C:\Python24\Lib\site-packages\win32com\client\__init__.py", line 446, in _ApplyTypes_
> return self._get_good_object_(
>ValueError: invalid literal for int(): /usb/ARM0
>
>The documentation claims that the argument is a pointer to a string. Looking in PythonWin's COM browser, it appears that the object is expecting an integer pointer. Is there a way to get around this?
>
>
The people who wrote this must have been idiots. They do want a string,
but they declared all the string parameters as "unsigned char *" instead
of "char *". I don't know how to make this work with Python.
By the way, it wasn't entirely reasonable of you to expect us to
download and install an 11 megabyte product just for one 85k byte dll.
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20060922/70db0b2b/attachment.html
More information about the Python-win32
mailing list