Com object questions

Discussion in 'Python' started by Gijs Korremans, May 23, 2005.

  1. 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
     
    Gijs Korremans, May 23, 2005
    #1
    1. Advertising

  2. Gijs Korremans

    Roger Upole Guest

    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" <> wrote in message
    news:...
    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




    ----== 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 =---
     
    Roger Upole, May 23, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ali Syed
    Replies:
    3
    Views:
    584
    Mark McIntyre
    Oct 13, 2004
  2. pkirk25
    Replies:
    50
    Views:
    1,169
    Bill Pursell
    Oct 4, 2006
  3. Replies:
    10
    Views:
    581
  4. Vijay
    Replies:
    2
    Views:
    664
    Öö Tiib
    May 7, 2010
  5. reema
    Replies:
    0
    Views:
    312
    reema
    Aug 26, 2008
Loading...

Share This Page