Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7905141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:21:50+00:00 2026-06-03T10:21:50+00:00

I’m trying to use with Python a COM server which expose only the IDispatch

  • 0

I’m trying to use with Python a COM server which expose only the IDispatch interface and have neither IDL file nor type library for it. I do have documentation for the different methods and how to use them.

Trying to use the win32com package fails for me, because it seems that when no type information is available win32com fallback to assuming any attribute access is property get or set, never a method invocation.

That is, when I do the following:

  import win32com.client
  c = win32com.client.GetActiveObject(server_progid)
  c.someServerMethod(arg1, arg2)

win32com tries to get the someServerMethod property on the server, ignoring arg1, arg2 completely. Digging into the code it seems because the python is invoking self.__getattr__ which has no arg1, arg2.

I’m looking for a way to solve this:

  • Some syntax to tell win32com I’m actually calling a method ;
  • Some other python COM client which actually implement this behavior ;
  • Other suggestions, except the obvious ‘manually convert the documentation into type-library’.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T10:21:53+00:00Added an answer on June 3, 2026 at 10:21 am

    A possible solution (which I’m currently implementing) is to wrap the usage of win32com.client with a proxy which calls _make_method_ for every method invocation, using some logic. Using a code recipe from here I changed to method every property which does not start with get_ or set_ (just an example, any heuristic which allows to tell properties from methods will do).

    import new
    from types import MethodType
    
    class Proxy(object):
    
        def __init__(self, target):
            self._target = target
    
        def __getattr__(self, aname):
            target = self._target
            ### Beginning of special logic ###
            if aname[:4]!='set_' and aname[:4]!='get_':
            ### End of special logic ###
                # Rebind the method to the target.
                return new.instancemethod(f.im_func, self, target.__class__)
            else:
                return f
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I want use html5's new tag to play a wav file (currently only supported
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I have a text area in my form which accepts all possible characters from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have a reasonable size flat file database of text documents mostly saved in
I am trying to loop through a bunch of documents I have to put

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.