[ctypes-users] Comtypes: freezing a use of CreateObject
Brought to you by:
theller
From: Don D. <ddw...@ad...> - 2008-06-14 04:39:39
|
I've successfully used CreateObject to get a reference to a COM object in an application, at least while running the source file. Now, I need to package it up into a .exe with py2exe to be distributed. My attempts to do this have come to naught so far -- the use of the object returned by CreateObject in the exe causes an exception (access violation). The code creates the object with the following: > from comtypes.client import CreateObject > frobulator = CreateObject('AptUtilities.clsFrob') ... and it gets used as follows: > _, frodo = frobulator.defrob(frobee) It's at this point that it blows up in the exe, but succeeds when running the source. In my setup.py, I included the following lines: > import comtypes.gen.aptUtilities and > 'includes':['pyodbc', 'twisted.web.resource', > 'comtypes.gen.aptUtilities'], in the py2exe options. From the output, it looks as though aptUtilities is getting included, but the result is the same as without those lines. Is there something I'm missing, or is this doomed from the start? (I'm running Python 2.4 and comtypes 0.4.1.) Thanks for any good words, -- Don Dwiggins Advanced Publishing Technology |