microsoft / xlang

MIT License
877 stars 103 forks source link

Python: can't use CameraCaptureUI #759

Closed oxygen-dioxide closed 1 year ago

oxygen-dioxide commented 3 years ago
>>> from winrt.windows.media.capture import CameraCaptureUI
>>> cap=CameraCaptureUI()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: 不支持从 MTA 中激活单线程类

windows 22454

dlech commented 3 years ago

This is due to the fact that the library currently initializes itself as a multi-threaded apartment (MTA). Programs with a graphical user interface need to have a single-threaded apartment (STA). See discussion in #690.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 10 days with no activity. Remove stale label or comment or this will be closed in 5 days.