interfaces.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:PythonForWindows 作者: hakril 项目源码 文件源码
def _create_vtable(self, interface):
        implems = []
        names = []
        for index, name, method in self.extract_methods_order(interface):
            func_implem = getattr(self, name)
            #PVOID is 'this'
            types = [method.restype, PVOID] + list(method.argtypes)
            implems.append(ctypes.WINFUNCTYPE(*types)(func_implem))
            names.append(name)
        class Vtable(ctypes.Structure):
            _fields_ = [(name, ctypes.c_void_p) for name in names]
        return Vtable(*[ctypes.cast(x, ctypes.c_void_p) for x in implems]), implems
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号