pywinauto TypeError:_argtypes_uu中的项2通过值传递union,这是不受支持的

2024-09-24 08:38:29 发布

您现在位置:Python中文网/ 问答频道 /正文

我用的是pywinauto

Python 3.7.6 pywinauto 0.6.8

我没有导入pywinauto模块的问题,但有以下问题:

代码:

from pywinauto.application import Application
app = Application(backend="uia").start("thinkorswim.exe")

结果:

Traceback (most recent call last):
  File "C:\Users\willi\AppData\Local\Programs\Python\Python37\lib\ctypes\__init__.py", line 121, in WINFUNCTYPE
    return _win_functype_cache[(restype, argtypes, flags)]
KeyError: (<class 'ctypes.HRESULT'>, (<class 'ctypes.c_long'>, <class 'comtypes.automation.tagVARIANT'>, <class 'comtypes.LP_POINTER(IUIAutomationCondition)'>), 0)

During handling of the above exception, another exception occurred:

    prototype = WINFUNCTYPE(restype, *argtypes)
  File "C:\Users\willi\AppData\Local\Programs\Python\Python37\lib\ctypes\__init__.py", line 123, in WINFUNCTYPE
    class WinFunctionType(_CFuncPtr):
TypeError: item 2 in _argtypes_ passes a union by value, which is unsupported.

有朋友能帮忙吗


Tags: inapplicationliblocalctypesusersappdataclass