I was having intermittent problems creating a Python COM object that I am using
as a test/learning exercise. What I finally noticed was that when I was command
line registering the object I was not consistent in typing the name of the
python file.
Executing the DOS command line:
python TestMsgBox.py -regserver
Yields the following registry entry:
HKEY_CLASSES_ROOT\CLSID\{a4c0208f-8888-11e1-ac67-b8ac6f92cf9d}\InprocServer32
PythonClass = "TestMsgBox.TestMsgBox"
Executing the DOS command line:
python TestMsgBox.py -regserver
Yields the following registry entry:
HKEY_CLASSES_ROOT\CLSID\{a4c0208f-8888-11e1-ac67-b8ac6f92cf9d}\InprocServer32
PythonClass = "testmsgbox.TestMsgBox"
I created the smallest sample I could to reproduce it.
import comtypes
class TestMsgBox( comtypes.IUnknown ):
_case_insensitive_ = True
_reg_threading_ = "Both"
_reg_progid_ = "TestMsgBoxLib.TestMsgBox"
_reg_desc_ = "MessageBox sample for testing"
_reg_clsctx_ = comtypes.CLSCTX_INPROC_SERVER |
comtypes.CLSCTX_LOCAL_SERVER
_reg_clsid_ = "{a4c0208f-8888-11e1-ac67-b8ac6f92cf9d}"
if __name__ == "__main__":
from comtypes.server.register import UseCommandLine
UseCommandLine(TestMsgBox)
I don't know if this was intended behavior but I had not seen it documented.
_______________________________________________
python-win32 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-win32