글
[Assertion failed] wincore.cpp error line 952
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
'Skills > Programming' 카테고리의 다른 글
KB954430 자꾸만 다시 설치하라고 할 때.. (0) | 2015.06.08 |
---|---|
MATLAB에서 Figure docking (default) (1) | 2015.05.21 |
C++ 반전 연산자~와 논리 연산자 !의 차이 (0) | 2014.12.16 |
공유 메모리를 이용한 IPC (0) | 2014.12.15 |
MFC dialog에서 콘솔(console)로 디버깅하기 (0) | 2014.12.15 |