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 8211967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:36:24+00:00 2026-06-07T10:36:24+00:00

I have been tasked with figuring out how to use python to communicate with

  • 0

I have been tasked with figuring out how to use python to communicate with the DDC4100 digital controller. The DDC4100 is a component of the DLP Discovery 4100 Development kit. If you are curious about what that is you can click here.

I have been using PythonWin and the pywin32 packages to attempt to communicate with the controller.

I would like to use early binding automation so I used makepy to generate a wrapper for the DDC4100 ActiveX Control module.

# -*- coding: mbcs -*-
# Created by makepy.py version 0.5.01
# By python version 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)]
# From type library 'DDC4100.tlb'
# On Fri Jul 06 10:52:42 2012
'DDC4100 ActiveX Control module'
makepy_version = '0.5.01'
python_version = 0x20703f0

import win32com.client.CLSIDToClass, pythoncom, pywintypes
import win32com.client.util
from pywintypes import IID
from win32com.client import Dispatch

# The following 3 lines may need tweaking for the particular server
# Candidates are pythoncom.Missing, .Empty and .ArgNotFound
defaultNamedOptArg=pythoncom.Empty
defaultNamedNotOptArg=pythoncom.Empty
defaultUnnamedArg=pythoncom.Empty

CLSID = IID('{4AB30830-EFC0-496D-8D38-ACFE2518ECEB}')
MajorVersion = 1
MinorVersion = 0
LibraryFlags = 10
LCID = 0x0

from win32com.client import DispatchBaseClass
class _DDDC4100(DispatchBaseClass):
    'Dispatch interface for DDC4100 Control'
    CLSID = IID('{C4374661-BB24-410F-9BEB-5DED735F4985}')
    coclass_clsid = IID('{5C75C113-9AFC-42AC-8CED-1ABFE27763B5}')

    def AboutBox(self):
        return self._oleobj_.InvokeTypes(-552, LCID, 1, (24, 0), (),)

    def AllowMessages(self, value=defaultNamedNotOptArg):
        return self._oleobj_.InvokeTypes(11, LCID, 1, (2, 0), ((2, 0),),value
            )

    def Clear(self, BlockNum=defaultNamedNotOptArg, DoReset=defaultNamedNotOptArg):
        return self._oleobj_.InvokeTypes(3, LCID, 1, (2, 0), ((2, 0), (2, 0)),BlockNum
            , DoReset)

    def ConnectDevice(self, DeviceNum=defaultNamedNotOptArg, SrcFile=defaultNamedNotOptArg):
        return self._oleobj_.InvokeTypes(14, LCID, 1, (2, 0), ((2, 0), (8, 0)),DeviceNum
            , SrcFile)

    def ConvertImage(self, SrcFile=defaultNamedNotOptArg, DestFile=defaultNamedNotOptArg, MirrorImage=defaultNamedNotOptArg):
        return self._oleobj_.InvokeTypes(4, LCID, 1, (2, 0), ((8, 0), (8, 0), (2, 0)),SrcFile
            , DestFile, MirrorImage)

    def DownloadAppsFPGACode(self, FileName=defaultNamedNotOptArg):
        return self._oleobj_.InvokeTypes(12, LCID, 1, (2, 0), ((8, 0),),FileName
            )

    def FileToFrameBuffer(self, ImageFile=defaultNamedNotOptArg, MirrorImage=defaultNamedNotOptArg):
        return self._oleobj_.InvokeTypes(6, LCID, 1, (2, 0), ((8, 0), (2, 0)),ImageFile
            , MirrorImage)

    def FloatMirrors(self):
        return self._oleobj_.InvokeTypes(5, LCID, 1, (2, 0), (),)

    def GetActiveXRev(self):
        return self._oleobj_.InvokeTypes(13, LCID, 1, (3, 0), (),)

    def GetBlkAd(self):
        return self._oleobj_.InvokeTypes(22, LCID, 1, (2, 0), (),)

    def GetBlkMd(self):
        return self._oleobj_.InvokeTypes(20, LCID, 1, (2, 0), (),)

    def GetCOMPDATA(self):
        return self._oleobj_.InvokeTypes(32, LCID, 1, (2, 0), (),)

    def GetDDCVERSION(self):
        return self._oleobj_.InvokeTypes(2, LCID, 1, (2, 0), (),)

    def GetDLLRev(self):
        return self._oleobj_.InvokeTypes(17, LCID, 1, (3, 0), (),)

    def GetDMDTYPE(self):
        return self._oleobj_.InvokeTypes(1, LCID, 1, (2, 0), (),)

    def GetDriverRev(self):
        return self._oleobj_.InvokeTypes(15, LCID, 1, (3, 0), (),)

    def GetEXTRESETENBL(self):
        return self._oleobj_.InvokeTypes(40, LCID, 1, (2, 0), (),)

    def GetFPGARev(self):
        return self._oleobj_.InvokeTypes(47, LCID, 1, (3, 0), (),)

    def GetFirmwareRev(self):
        return self._oleobj_.InvokeTypes(16, LCID, 1, (2, 0), (),)

    def GetGPIO(self):
        return self._oleobj_.InvokeTypes(42, LCID, 1, (2, 0), (),)

    def GetNSFLIP(self):
        return self._oleobj_.InvokeTypes(34, LCID, 1, (2, 0), (),)

    def GetNumDevices(self):
        return self._oleobj_.InvokeTypes(46, LCID, 1, (2, 0), (),)

    def GetPWRFLOAT(self):
        return self._oleobj_.InvokeTypes(38, LCID, 1, (2, 0), (),)

    def GetRST2BLKZ(self):
        return self._oleobj_.InvokeTypes(24, LCID, 1, (2, 0), (),)

    def GetResetComplete(self, waittime=defaultNamedNotOptArg):
        return self._oleobj_.InvokeTypes(49, LCID, 1, (2, 0), ((3, 0),),waittime
            )

    def GetRowAddr(self):
        return self._oleobj_.InvokeTypes(28, LCID, 1, (2, 0), (),)

    def GetRowMd(self):
        return self._oleobj_.InvokeTypes(26, LCID, 1, (2, 0), (),)

    def GetSTEPVCC(self):
        return self._oleobj_.InvokeTypes(30, LCID, 1, (2, 0), (),)

    def GetSpeedMode(self):
        return self._oleobj_.InvokeTypes(18, LCID, 1, (2, 0), (),)

    def GetWDT(self):
        return self._oleobj_.InvokeTypes(36, LCID, 1, (2, 0), (),)

    def IsDeviceAttached(self):
        return self._oleobj_.InvokeTypes(43, LCID, 1, (11, 0), (),)

    def LoadControl(self):
        return self._oleobj_.InvokeTypes(45, LCID, 1, (2, 0), (),)

    def LoadData(self, data=defaultNamedNotOptArg, length=defaultNamedNotOptArg):
        return self._oleobj_.InvokeTypes(44, LCID, 1, (2, 0), ((16386, 0), (2, 0)),data
            , length)

    def LoadImageFileToBuffer(self, FileName=defaultNamedNotOptArg, ImageBufferPtr=defaultNamedNotOptArg, MirrorImage=defaultNamedNotOptArg):
        return self._oleobj_.InvokeTypes(9, LCID, 1, (2, 0), ((8, 0), (16386, 0), (2, 0)),FileName
            , ImageBufferPtr, MirrorImage)

    def LoadToDMD(self, BlockNum=defaultNamedNotOptArg, DoReset=defaultNamedNotOptArg):
        return self._oleobj_.InvokeTypes(7, LCID, 1, (2, 0), ((2, 0), (2, 0)),BlockNum
            , DoReset)

    def MemToFrameBuffer(self, ImageBufferPtr=defaultNamedNotOptArg):
        return self._oleobj_.InvokeTypes(8, LCID, 1, (2, 0), ((16386, 0),),ImageBufferPtr
            )

    def Reset(self, BlockNum=defaultNamedNotOptArg):
        return self._oleobj_.InvokeTypes(10, LCID, 1, (2, 0), ((2, 0),),BlockNum
            )

    def SetBlkAd(self, value=defaultNamedNotOptArg):
        return self._oleobj_.InvokeTypes(21, LCID, 1, (2, 0), ((2, 0),),value
            )

    def SetBlkMd(self, value=defaultNamedNotOptArg):
        return self._oleobj_.InvokeTypes(19, LCID, 1, (2, 0), ((2, 0),),value
            )

    def SetCOMPDATA(self, value=defaultNamedNotOptArg):
        return self._oleobj_.InvokeTypes(31, LCID, 1, (2, 0), ((2, 0),),value
            )

    def SetConversionThreshold(self, threshold=defaultNamedNotOptArg):
        return self._oleobj_.InvokeTypes(48, LCID, 1, (2, 0), ((2, 0),),threshold
            )

    def SetEXTRESETENBL(self, value=defaultNamedNotOptArg):
        return self._oleobj_.InvokeTypes(39, LCID, 1, (2, 0), ((2, 0),),value
            )

    def SetGPIO(self, value=defaultNamedNotOptArg):
        return self._oleobj_.InvokeTypes(41, LCID, 1, (2, 0), ((2, 0),),value
            )

    def SetNSFLIP(self, value=defaultNamedNotOptArg):
        return self._oleobj_.InvokeTypes(33, LCID, 1, (2, 0), ((2, 0),),value
            )

    def SetPWRFLOAT(self, value=defaultNamedNotOptArg):
        return self._oleobj_.InvokeTypes(37, LCID, 1, (2, 0), ((2, 0),),value
            )

    def SetRST2BLKZ(self, value=defaultNamedNotOptArg):
        return self._oleobj_.InvokeTypes(23, LCID, 1, (2, 0), ((2, 0),),value
            )

    def SetRowAddr(self, value=defaultNamedNotOptArg):
        return self._oleobj_.InvokeTypes(27, LCID, 1, (2, 0), ((2, 0),),value
            )

    def SetRowMd(self, value=defaultNamedNotOptArg):
        return self._oleobj_.InvokeTypes(25, LCID, 1, (2, 0), ((2, 0),),value
            )

    def SetSTEPVCC(self, value=defaultNamedNotOptArg):
        return self._oleobj_.InvokeTypes(29, LCID, 1, (2, 0), ((2, 0),),value
            )

    def SetWDT(self, value=defaultNamedNotOptArg):
        return self._oleobj_.InvokeTypes(35, LCID, 1, (2, 0), ((2, 0),),value
            )

    _prop_map_get_ = {
    }
    _prop_map_put_ = {
    }

class _DDDC4100Events:
    'Event interface for DDC4100 Control'
    CLSID = CLSID_Sink = IID('{0CC72AA0-956F-48BD-9118-4446866ECBE3}')
    coclass_clsid = IID('{5C75C113-9AFC-42AC-8CED-1ABFE27763B5}')
    _public_methods_ = [] # For COM Server support
    _dispid_to_func_ = {
    }

    def __init__(self, oobj = None):
        if oobj is None:
            self._olecp = None
        else:
            import win32com.server.util
            from win32com.server.policy import EventHandlerPolicy
            cpc=oobj._oleobj_.QueryInterface(pythoncom.IID_IConnectionPointContainer)
            cp=cpc.FindConnectionPoint(self.CLSID_Sink)
            cookie=cp.Advise(win32com.server.util.wrap(self, usePolicy=EventHandlerPolicy))
            self._olecp,self._olecp_cookie = cp,cookie
    def __del__(self):
        try:
            self.close()
        except pythoncom.com_error:
            pass
    def close(self):
        if self._olecp is not None:
            cp,cookie,self._olecp,self._olecp_cookie = self._olecp,self._olecp_cookie,None,None
            cp.Unadvise(cookie)
    def _query_interface_(self, iid):
        import win32com.server.util
        if iid==self.CLSID_Sink: return win32com.server.util.wrap(self)

    # Event Handlers
    # If you create handlers, they should have the following prototypes:


from win32com.client import CoClassBaseClass
# This CoClass is known by the name 'DDC4100.DDC4100Ctrl.1'
class DDC4100(CoClassBaseClass): # A CoClass
    # DDC4100 Control
    CLSID = IID('{5C75C113-9AFC-42AC-8CED-1ABFE27763B5}')
    coclass_sources = [
        _DDDC4100Events,
    ]
    default_source = _DDDC4100Events
    coclass_interfaces = [
        _DDDC4100,
    ]
    default_interface = _DDDC4100

RecordMap = {
}

CLSIDToClassMap = {
    '{C4374661-BB24-410F-9BEB-5DED735F4985}' : _DDDC4100,
    '{5C75C113-9AFC-42AC-8CED-1ABFE27763B5}' : DDC4100,
    '{0CC72AA0-956F-48BD-9118-4446866ECBE3}' : _DDDC4100Events,
}
CLSIDToPackageMap = {}
win32com.client.CLSIDToClass.RegisterCLSIDsFromDict( CLSIDToClassMap )
VTablesToPackageMap = {}
VTablesToClassMap = {
}


NamesToIIDMap = {
    '_DDDC4100Events' : '{0CC72AA0-956F-48BD-9118-4446866ECBE3}',
    '_DDDC4100' : '{C4374661-BB24-410F-9BEB-5DED735F4985}',
}

I then used Dispatch to create the control object.

from win32com.client import Dispatch
DDC4100 = Dispatch('DDC4100.DDC4100Ctrl.1')

Now when I attept to call one of the functions from the wrapper I am presented with an error.

DDC4100.AboutBox()
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 505, in   __getattr__
ret = self._oleobj_.Invoke(retEntry.dispid,0,invoke_type,1)
com_error: (-2147418113, 'Catastrophic failure', None, None)

It seems like the makepy wrapper is not automatically being loaded and so I attempted using the EnsureModule() function form gencache and I still recieve the same error. At this point I do not know what to do since I have gone through this same process with a couple other programs within the registered type libraries and have had no problems. Does anyone see any errors in my methods or logic or know of a different way to go about using an ActiveX control?

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

    Usually, that error means the ActiveX control requires a full container.
    You could try embedding it in a web page running in IE, which acts as an ActiveX
    container.

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

Sidebar

Related Questions

I have been tasked with figuring out why a jquery slider won't function. I
I have been tasked with figuring out how many lines of code I've written
I have been tasked with figuring out a state space for a problem based
I have been tasked with designing my web services client code to use the
I have been tasked with writing an installer with a silverlight out of browser
I have been tasked with finding a good fit for a database to use
I have been tasked with converting some scripts referencing an Informix database to be
I have been tasked with porting a large Java codebase to the Android platform.
I have been tasked with refactoring some components that used xmlbeans to now make
I have been tasked to develop an interactive website using java & mysql: using

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.