[Assertion failed] wincore.cpp error line 952

Skills/Programming 2015. 1. 15. 13:29

MFC does not support calling a window from a thread that did not create the window. Your call to OnIdle violates that restriction.

Each thread uses a separate message queue, so it is also a bad idea to attempt to use the main message queue from your thread.

Why are you creating windows in your thread? It is best to create all windows in the main thread, and use secondary threads for non-GUI processing.

When you create a thread in an MFC program you are supposed to use AfxBeginThread, not the CreateThread API.  AfxBeginThread will call CreateThread for you, after doing whatever MFC needs in order to work properly.


* Ref

https://social.msdn.microsoft.com/Forums/vstudio/en-US/38f58a71-2d5f-44fd-b3a1-37bafa6e54bd/assert-in-multithread-program-with-function-onidle0?forum=vcgeneral


설정

트랙백

댓글