Python COM

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • birdprince@gmail.com

    Python COM

    I have implemented a COM in C++,buy i don't know how to use this COM
    in python.
    For example: the COM's ProgID is "MyCOM1.AdvMeth od".this COM have two
    interfaces,the default interface's name is IAdvMethod,the second
    interface's name is IBasicMethod.
    How do i use those interfaces in python.Thank you very much,please
    answer my question in code.
  • Diez B. Roggisch

    #2
    Re: Python COM

    birdprince@gmai l.com schrieb:
    I have implemented a COM in C++,buy i don't know how to use this COM
    in python.
    For example: the COM's ProgID is "MyCOM1.AdvMeth od".this COM have two
    interfaces,the default interface's name is IAdvMethod,the second
    interface's name is IBasicMethod.
    How do i use those interfaces in python.Thank you very much,please
    answer my question in code.



    Diez

    Comment

    • Méta-MCI \(MVP\)

      #3
      Re: Python COM

      Hi!

      Example, with Pywin32:

      import win32com.client
      moncom = win32com.client .Dispatch('MyCO M1.AdvMethod')
      moncom.IAdvMeth od(...

      See Pywin32 here: http://sourceforge.net/projects/pywin32/

      @-salutations

      Michel Claveau

      Comment

      • Diez B. Roggisch

        #4
        Re: Python COM

        Méta-MCI (MVP) wrote:
        Hi!
        >
        Example, with Pywin32:
        >
        import win32com.client
        moncom = win32com.client .Dispatch('MyCO M1.AdvMethod')
        moncom.IAdvMeth od(...
        >
        See Pywin32 here: http://sourceforge.net/projects/pywin32/
        That's not working, because the OP has a custom interface, not
        IDispatch-based.

        Diez

        Comment

        • Michel Claveau - NoSpam SVP ; merci

          #5
          Re: Python COM

          Re!

          Pywin32 can use dynamic COM server (without tlb).
          Therefore, I prefer to wait the return from birdprince...

          @-salutations
          --
          Michel Claveau


          Comment

          • Larry Bates

            #6
            Re: Python COM

            birdprince@gmai l.com wrote:
            I have implemented a COM in C++,buy i don't know how to use this COM
            in python.
            For example: the COM's ProgID is "MyCOM1.AdvMeth od".this COM have two
            interfaces,the default interface's name is IAdvMethod,the second
            interface's name is IBasicMethod.
            How do i use those interfaces in python.Thank you very much,please
            answer my question in code.
            Suggestion: Post this to comp.python.win dows instead of here. I think you will
            find that a better place for this question.

            -Larry

            Comment

            Working...