Com object questions

G

Gijs Korremans

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(dispid, 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
 
R

Roger Upole

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

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(dispid, 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top