Thread: How to catch the exception from timer call back function
|
Replies:
2
-
Last Post:
Apr 24, 2018 9:14 PM
Last Post By: velrajan muthuvel
|
Threads:
[
Previous
|
Next
]
|
|
Posts:
28
Registered:
9/22/14
|
|
Hi,
Please help me how to catch the exception from timer call back function?
Currently I am using the CreateTimerQueueTimer() function for triggering the timer function for specified interval.
|
|
|
Posts:
9,447
Registered:
12/23/01
|
|
velrajan muthuvel wrote:
Please help me how to catch the exception from timer call back
function?
Win32 API callbacks don't generate exceptions. If you are getting an
exception, it has to be coming from your own code inside the callback.
So ust wrap the code in a try/catch or __try/__except block, depending
on the nature of the exception, and handle it as needed.
--
Remy Lebeau (TeamB)
|
|
|
|
Posts:
28
Registered:
9/22/14
|
|
Hi Remy,
Thank you for your support.
I wrapped with try/ catch block in my timer function. But when I execute the application, I got below exception
1. Frame Work.exe raised exception class $ul with message Exception Object Address: OxF9ODA88’.
2. FrameWork.exe raised exception class $TException with message Exception Object Address:
OxF9C1F2O.
3.FrameWork.exe raised exception class Exception with message ‘Messages must be shown in the main UI
thread.’.
Could you help me how to fix it.
Velrajan M
velrajan muthuvel wrote:
Please help me how to catch the exception from timer call back
function?
Win32 API callbacks don't generate exceptions. If you are getting an
exception, it has to be coming from your own code inside the callback.
So ust wrap the code in a try/catch or __try/__except block, depending
on the nature of the exception, and handle it as needed.
--
Remy Lebeau (TeamB)
|
|
|
|
Legend
|
|
Helpful Answer
(5 pts)
|
|
Correct Answer
(10 pts)
|
|
Connect with Us