- Messages
- 531
- Country

Hello experts,
For those of you who develop in C/C++ using the Windows API, I would like to share a problem I had.
I am developing a DLL module that is loaded when FSX starts, it gets the FSX window handle to get the messages such as key up/down events to manage them. In addition, I had to use a timer that I set with the SetTimer function, easy. Usually I use this function with the timer proc set to NULL, which means the timer sends a WM_TIMER event to the window at each timer period, something like:
It usually works fine, in this case the window receives a WM_TIMER event every 50 ms. But this time, it didn't and I can't understand why. I put a trace when the WM_TIMER event occurs, and it shows only one. Strange... I changed the timer creation in order to call a static function instead, something like:
And it works this way, the "tick" function is called every 50 ms. I can consider the problem is solved but I am not very happy about this workaround. I'd rather manage the timer with a window event as I usually do.
Do you have any idea why one mode works and not the other? Did you ever have the same problem?
Thanks,
Eric
For those of you who develop in C/C++ using the Windows API, I would like to share a problem I had.
I am developing a DLL module that is loaded when FSX starts, it gets the FSX window handle to get the messages such as key up/down events to manage them. In addition, I had to use a timer that I set with the SetTimer function, easy. Usually I use this function with the timer proc set to NULL, which means the timer sends a WM_TIMER event to the window at each timer period, something like:
Code:
SetTimer(hFSimWindow, 0, 50, (TIMERPROC)NULL);
Code:
SetTimer(hFSimWindow, 0, 50, (TIMERPROC)tick);
Do you have any idea why one mode works and not the other? Did you ever have the same problem?
Thanks,
Eric

