Beispiel #1
0
def serve(clsids):
    infos = factory.RegisterClassFactories(clsids)

    pythoncom.EnableQuitMessage(win32api.GetCurrentThreadId())
    pythoncom.CoResumeClassObjects()

    pythoncom.PumpMessages()

    factory.RevokeClassFactories(infos)

    pythoncom.CoUninitialize()
Beispiel #2
0
win32com.__gen_path__ = genPath
sys.modules["win32com.gen_py"].__path__ = [genPath]
win32com.client.gencache.is_readonly = False

# Support for the COM-Server of the program
if hasattr(sys, "frozen"):
    pythoncom.frozen = 1

try:
    RegisterClasses(EventGhostCom, quiet=True)
except pywintypes.error, data:
    if data[0] != 5:
        raise
sys.coinit_flags = 2
try:
    __factory_infos = factory.RegisterClassFactories(
        [EventGhostCom._reg_clsid_])
except:
    __factory_infos = []
    eg.PrintError("RegisterClassFactories failed!")
#import win32api
#pythoncom.EnableQuitMessage(win32api.GetCurrentThreadId())
pythoncom.CoResumeClassObjects()

try:
    e = win32com.client.Dispatch("EventGhost")
except:
    sys.stderr.write("Unable to establish COM dispatch!\n")


def DeInit():
    # shutdown COM-Server