Can not load UIAutomationCore.dll.
1, You may need to install Windows Update KB971513 if your OS is Windows XP, see https://github.com/yinkaisheng/WindowsUpdateKB971513ForIUIAutomation
2, you need to use an UIAutomationInitializerInThread object in a thread, see demos/uiautomation_in_thread.py
[2021-12-02 14:03:24,284] ERROR in app: Exception on /send_msg [POST]
Traceback (most recent call last):
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\flask\app.py", line 2073, in wsgi_app
response = self.full_dispatch_request()
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\flask\app.py", line 1518, in full_dispatch_request
rv = self.handle_user_exception(e)
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\flask\app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\flask\app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "E:\xla\runjian\python\stock-manage\app.py", line 11, in send_msg
wx.ChatWith(who)
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\wxauto\wxauto.py", line 185, in ChatWith
self.UiaAPI.SwitchToThisWindow()
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\uiautomation\uiautomation.py", line 7437, in SwitchToThisWindow
if self.IsTopLevel():
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\uiautomation\uiautomation.py", line 6765, in IsTopLevel
handle = self.NativeWindowHandle
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\uiautomation\uiautomation.py", line 6094, in NativeWindowHandle
handle = self.Element.CurrentNativeWindowHandle
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\uiautomation\uiautomation.py", line 6218, in Element
self.Refind(maxSearchSeconds=TIME_OUT_SECOND, searchIntervalSeconds=self.searchInterval)
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\uiautomation\uiautomation.py", line 6466, in Refind
if not self.Exists(maxSearchSeconds, searchIntervalSeconds, False if raiseException else DEBUG_EXIST_DISAPPEAR):
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\uiautomation\uiautomation.py", line 6416, in Exists
control = FindControl(self.searchFromControl, self._CompareFunction, self.searchDepth, False, self.foundIndex)
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\uiautomation\uiautomation.py", line 8315, in FindControl
control = GetRootControl()
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\uiautomation\uiautomation.py", line 8093, in GetRootControl
return Control.CreateControlFromElement(AutomationClient.instance().IUIAutomation.GetRootElement())
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\uiautomation\uiautomation.py", line 52, in instance
cls.instance = cls()
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\uiautomation\uiautomation.py", line 69, in init
raise ex
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\uiautomation\uiautomation.py", line 60, in init
self.IUIAutomation = comtypes.client.CreateObject("{ff48dba4-60ef-4201-aa87-54103eef594e}", interface=self.UIAutomationCore.IUIAutomation)
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\comtypes\client_init.py", line 238, in CreateObject
obj = comtypes.CoCreateInstance(clsid, clsctx=clsctx, interface=interface)
File "D:\Users\xulia\miniconda3\envs\pytest-auto\lib\site-packages\comtypes_init.py", line 1219, in CoCreateInstance
_ole32.CoCreateInstance(byref(clsid), punkouter, clsctx, byref(iid), byref(p))
File "_ctypes/callproc.c", line 922, in GetResult
OSError: [WinError -2147221008] 尚未调用 CoInitialize。