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

  • SEARCH
  • Home
  • 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 8358883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:57:05+00:00 2026-06-09T10:57:05+00:00

Here is a COM server implemented in Python: from win32com.server.exception import COMException import pythoncom

  • 0

Here is a COM server implemented in Python:

from win32com.server.exception import COMException
import pythoncom
import sys
import os
from string import Template
import logging
import logging.config

class Connector:
    _reg_clsctx_ = pythoncom.CLSCTX_LOCAL_SERVER
    _reg_clsid_ = "{0CE25AEB-1AFA-4DA7-97BD-F93CDBFB376C}"
    _reg_desc_ = "Python Test COM Server"
    _reg_progid_ = "Compy.Connect"
    _public_methods_ = ['Process', 'Status']
    _public_attrs_ = []
    _readonly_attrs_ = []

    def Process(self, what):
        pass

    def Status(self):
        return Template("""
        Current Directory: $dir
        Installed: $script
        PythonPATH: $pyPath
        """).substitute(dir = os.getcwd(),
                        script = os.path.abspath(__file__),
                        pyPath = sys.path)

if __name__ == '__main__':
    import win32com.server.register
    win32com.server.register.UseCommandLine(Connector)

It registers ok.
When it is run it causes the following to occur on the production machine but NOT on the development box:

>>> cc = CreateObject("Compy.Connect")
>>> cc.Status()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python26\lib\site-packages\comtypes\client\dynamic.py", line 42, in _
_call__
    return self._obj._comobj.Invoke(self._id, *args)
  File "C:\Python26\lib\site-packages\comtypes\automation.py", line 717, in Invo
ke
raise COMError(hresult, text, details)
_ctypes.COMError: (-2147352567, 'Exception occurred.', (u"Unexpected Python Erro
r: AttributeError: 'module' object has no attribute 'VARIANT'\n", u'Python COM S
erver Internal Error', None, 0L, -2147467259))
>>>

I have installed comtypes 0.6.2. Running Python 2.6.6

  • 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-09T10:57:07+00:00Added an answer on June 9, 2026 at 10:57 am

    The VARIANT class was introduced in Pywin32 build 217.
    Try installing the latest version on the machine that
    it’s failing on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have implemented my Server application regarding this post here: http://www.codeguru.com/csharp/csharp/cs_network/sockets/article.php/c8781#Client1 Sum up: I
Using the client and server examples found here: http://www.winsocketdotnetworkprogramming.com/winsock2programming/winsock2advancedmailslot14.html Compiling them with VS2008, running
I've implemented my mail server as dictated here . It works perfectly fine. My
I am using the tutorial laid out here http://www.androidsnippets.com/vbnet-server-side-code-to-send-c2dm-messages to attempt to send a
So I followed this guide here http://www.kodyaz.com/articles/sql-server-2005-database-encryption-step-by-step.aspx on how to setup encryption for my
you can view full source code here dpaste.com/hold/167199 Error: delete() takes exactly 2 arguments
Example here: http://jezebel.com/5896408/racist-hunger-games-fans-dont-care-how-much-money-the-movie-made Click on the 3x3 Tweets screencap they have up. I love
http://pastebin.com/mYk8M038 here is what I have so far... I think it may be something
For eg: http://example.com/login Here is my site once I logged inside and uses User
Supppose you are here http://domain.com/category/month/123 . What's the correct way to put a link

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.