The ontimer function is executing on the UI thread. Long operations should be run on a worker thread to prevent them from blocking the user interface.
UI events and WM_TIMER MFC
abc abc
351
Reputation points
Hi,
In MFC Dialog based application, I am calling SetTimer and in ontimer I am calling a function which is a long operation. In the same dialog I have cancel button, If I click cancel button , I need to abort the long operation happening in the ontimer. After going inside the ontimer function, I could not click the cancel button.
How to receive UI events when ontimer is executed?