

def RegisterActiveObject(comobj, weak=True):
    punk = comobj._com_pointers_[comtypes.IUnknown._iid_]
    clsid = comobj._reg_clsid_
    if weak:
        flags = ACTIVEOBJECT_WEAK
    else:
        flags = ACTIVEOBJECT_STRONG
    handle = ctypes.c_ulong()
    oleaut32.RegisterActiveObject(punk, ctypes.byref(clsid), flags, ctypes.byref(handle))
    return handle.value

dataset/ETHPy150Open enthought/comtypes/comtypes/server/__init__.py RegisterActiveObject/original