Menu

#578 PyCWnd.SetActiveWindow raises invalid error

open
nobody
win32 (141)
5
2012-02-09
2012-02-09
kxroberto
No

PyCWnd.SetActiveWindow() sometimes fails with "The window was created in a different thread and can not be mapped.", though the function did its job.

Thats obviously (just) because it tries to convert the return value (previous window / CWnd* may be temporary according MSDN) with
"return PyCWnd::make( UITypeFromCObject(pRel), pRel)->GetGoodRet();" which uses FromHandlePermanent and some thread check or so.
Perhaps it needs a less rigid converter or return Non instead of failure.

Discussion