473,320 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Com object questions

Hi,

I'm still figuring out how I can use the win32com for the use of a com object which I think is made in VB

First I've created a file with MakePy
Then I used the following code to init the com object:
import win32com.client
Client = win32com.client.Dispatch("ClientModule.Client")

Then, when I want to use a function, for example this one:
ipaddr = kddClient.GetLocalIPAddress()
I get this error:
File "C:\Python23\lib\site-packages\win32com\gen_py\0F4570B8-4D39-47CD-84B4-8A424233EEBFx0x1x0.py", line 69, in GetLocalIPAddress
return self._ApplyTypes_(11, 1, (36, 0), (), 'GetLocalIPAddress', None,)
File "C:\Python23\lib\site-packages\win32com\client\__init__.py", line 446, in _ApplyTypes_
return self._get_good_object_(self._oleobj_.InvokeTypes(d ispid, 0, wFlags, retType, argTypes, *args),user, resultCLSID)
com_error: (-2147024809, 'The parameter is incorrect.', None, None)
I don't know which parameter is incorrect because the function doesn't needany parameters

and when I try to use a struct for the IP address using the following code:
ipaddr = win32com.client.Record("IPADDRESS_STRUCT", Client)
I get this message:
File "C:\Python23\lib\site-packages\win32com\client\__init__.py", line 403, in Record
raise ValueError, "The structure '%s' is not defined in module '%s'" %(name, package)
ValueError: The structure 'IPADDRESS_STRUCT' is not defined in module '<module 'win32com.gen_py.0F4570B8-4D39-47CD-84B4-8A424233EEBFx0x1x0' from 'C:\Python23\lib\site-packages\win32com\gen_py\0F4570B8-4D39-47CD-84B4-8A424233EEBFx0x1x0.pyc'>'
I think this means that there is no struct IPADDRESS_STRUCT defined in the com object but when I'm going to the ComBrowser in PythonWin it is in there.

I'm using python 2.3 with pywin32 build 203

Does anybody know what i'm doing wrong?

Kind regards,
Gijs

--
This message has been scanned for viruses and
dangerous content by Network Sentry, and is
believed to be clean.
http://www.networksentry.co.za

Jul 19 '05 #1
1 2332
Does IPADDRESSSTRUCT appear anywhere in the makepy-generated module ?
Specifically, there should be a RecordMap dict containing any defined
Records
and their GUID's.

Roger

"Gijs Korremans" <gi**@globaltrack.com> wrote in message
news:ma*************************************@pytho n.org...
Hi,

I'm still figuring out how I can use the win32com for the use of a com
object which I think is made in VB

First I've created a file with MakePy
Then I used the following code to init the com object:
import win32com.client
Client = win32com.client.Dispatch("ClientModule.Client")

Then, when I want to use a function, for example this one:
ipaddr = kddClient.GetLocalIPAddress()
I get this error:
File
"C:\Python23\lib\site-packages\win32com\gen_py\0F4570B8-4D39-47CD-84B4-8A424233EEBFx0x1x0.py",
line 69, in GetLocalIPAddress
return self._ApplyTypes_(11, 1, (36, 0), (), 'GetLocalIPAddress', None,)
File "C:\Python23\lib\site-packages\win32com\client\__init__.py", line 446,
in _ApplyTypes_
return self._get_good_object_(self._oleobj_.InvokeTypes(d ispid, 0,
wFlags, retType, argTypes, *args),user, resultCLSID)
com_error: (-2147024809, 'The parameter is incorrect.', None, None)
I don't know which parameter is incorrect because the function doesn't need
any parameters

and when I try to use a struct for the IP address using the following code:
ipaddr = win32com.client.Record("IPADDRESS_STRUCT", Client)
I get this message:
File "C:\Python23\lib\site-packages\win32com\client\__init__.py", line 403,
in Record
raise ValueError, "The structure '%s' is not defined in module '%s'" %
(name, package)
ValueError: The structure 'IPADDRESS_STRUCT' is not defined in module
'<module 'win32com.gen_py.0F4570B8-4D39-47CD-84B4-8A424233EEBFx0x1x0' from
'C:\Python23\lib\site-packages\win32com\gen_py\0F4570B8-4D39-47CD-84B4-8A424233EEBFx0x1x0.pyc'>'
I think this means that there is no struct IPADDRESS_STRUCT defined in the
com object but when I'm going to the ComBrowser in PythonWin it is in there.

I'm using python 2.3 with pywin32 build 203

Does anybody know what i'm doing wrong?

Kind regards,
Gijs

--
This message has been scanned for viruses and
dangerous content by Network Sentry, and is
believed to be clean.
http://www.networksentry.co.za


----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: sunaina | last post by:
This is the first program I am writing using PHP and Mysql. I am creating a game where user thinks of an object and my program guesses the object while asking series of yes/no questions. All a...
4
by: Tom | last post by:
I want to open a recordset object on an .asp page. When I open the recordset I would like to use a stored procedure that expects a parameter to be passed for the stored procedure. I will then use...
5
by: Sunny | last post by:
Hi, I have to implement client/server application. The client have to instaniate an remoting object via http and pass some auth info. If the auth is OK, the client should invoke a method (or...
4
by: Luke Matuszewski | last post by:
Here are some questions that i am interested about and wanted to here an explanation/discussion: 1. (general) Is the objectness in JavaScript was supported from the very first version of it (in...
0
by: rlueneberg | last post by:
I am getting this error when trying to add typed object "Questions" to Arraylist QuestionsList: Object reference not set to an instance of an object. --> r.QuestionsList.Add(q); I tried...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.