- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a dialog with an edit box. The edit box shows elapsed time and is updated by a Timer Proc
The edit box also allows for user override - DlgSetSub is used to kill the Timer when the box gains focus - the user can then enter data in the field. The user then writes the data and dismisses the dialog - which resets the timer
And this works very well initially
But after a while (the time is variable) The KillTimer fails - returning false with GetLastError also returning 0. And then the edit box is still being updated and the data entry is not possible.
So, any ideas why KillTimer would fail?
If its any help the code is pretty simple, and optimization is disabled, and linked with the multithread libraries.
Thankx for any help you can give
Jim
The edit box also allows for user override - DlgSetSub is used to kill the Timer when the box gains focus - the user can then enter data in the field. The user then writes the data and dismisses the dialog - which resets the timer
And this works very well initially
But after a while (the time is variable) The KillTimer fails - returning false with GetLastError also returning 0. And then the edit box is still being updated and the data entry is not possible.
So, any ideas why KillTimer would fail?
If its any help the code is pretty simple, and optimization is disabled, and linked with the multithread libraries.
Thankx for any help you can give
Jim
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - jim.cox
...The user then writes the data and dismisses the dialog - which resets the timer
And this works very well initially
But after a while (the time is variable) The KillTimer fails - returning false with GetLastError also returning 0. And then the edit box is still being updated and the data entry is not possible.
And this works very well initially
But after a while (the time is variable) The KillTimer fails - returning false with GetLastError also returning 0. And then the edit box is still being updated and the data entry is not possible.
Hard to tell without seeing your code, but KillTimer requires the same window handle and timer id arguments as were used in SetTimer, and the hwnd is presumably that of the dialog's parent window (?) since when the dialog "is dismissed" its handle is no longer valid; perhaps your code somehow allows the handle validity to get out of sync. I will assure you that there is no problem with KillTimer, and F90 optimization and multithread libraries have no effect on Win32 API functions. Note that all handles in F90 should be declared INTEGER(HANDLE). Also, be sure to invoke the SAVE intrinsic in your dialog procs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Paul Curtis
Hard to tell without seeing your code, but KillTimer requires the same window handle and timer id arguments as were used in SetTimer, and the hwnd is presumably that of the dialog's parent window (?) since when the dialog "is dismissed" its handle is no longer valid; perhaps your code somehow allows the handle validity to get out of sync.
I will assure you that there is no problem with KillTimer, and F90 optimization and multithread libraries have no effect on Win32 API functions.
Note that all handles in F90 should be declared INTEGER(HANDLE). Also, be sure to invoke the SAVE intrinsic in your dialog procs.
Thanks for the comments Paul
The dialog"dismisseal" is just SW_SHOWMINIMIZED - se I hope we are not losing the handle
It was not so much optimisation as thread timing I was thinking of - as I say it starts out working fine...
I'll check the definitions and I'll give that SAVE a try
Cheers
Jim
.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page