Com object questions

Gijs Korremans gijs at globaltrack.com
Mon May 23 06:06:20 EDT 2005


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

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




More information about the Python-list mailing list