|
-
Aug 3rd, 2002, 03:41 AM
#1
Thread Starter
Hyperactive Member
Using Timers in DLLs....
When my DLL is attached, I want to set a Timer.... Since there is no window handle, I'm using TimerProc and not processing WM_TIMER messages. Only problem is... MSDN states that.... "When you specify a TimerProc callback function, the default window procedure calls the callback function when it processes WM_TIMER. Therefore, you need to dispatch messages in the calling thread, even when you use TimerProc instead of processing WM_TIMER."
How can I dispatch messages in a DLL?! .... There must be some other way...
-
Aug 3rd, 2002, 03:52 AM
#2
Thread Starter
Hyperactive Member
I'm thinking the only way I can do this is by creating a window and using that to process the WM_TIMER message...
-
Aug 3rd, 2002, 04:42 AM
#3
Thread Starter
Hyperactive Member
Ok, nevermind.... It seems to be working fine without creating a window and specifying the window handle as NULL. Dunno why the MSDN said what it said.... since it works without using DispatchMessage API....
-
Aug 3rd, 2002, 12:03 PM
#4
Frenzied Member
You only have to DispatchMessage() if you specify a window handle, but dont process WM_TIMER messages.
Z.
-
Aug 3rd, 2002, 12:06 PM
#5
Monday Morning Lunatic
I usually use the timers as a callback (i.e. it just calls one of your functions directly, without the overhead of a window procedure).
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 3rd, 2002, 04:33 PM
#6
Thread Starter
Hyperactive Member
Ya park, thats what I've been doing since forever. And thats what I'm doing in my DLL. But it was just strange how the MSDN stated that you must dispatch messages whether you use a callback or not.. Which I found odd. And apparently that statement is incorrect.. Or typed wrong.
-
Aug 3rd, 2002, 04:56 PM
#7
Monday Morning Lunatic
Or maybe it's just filling up your process's message queue 
Strange, I never seemed to have any problems by not handling WM_TIMER...although the dubious stability of my computer could have either been that or Windows 98...
I stopped using SetTimer when I noticed it was decidedly inaccurate...timeSetEvent is a lot better, and doesn't do things to the message queue.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 4th, 2002, 05:25 PM
#8
Thread Starter
Hyperactive Member
Hmmm, I think I might start using timeSetEvent now... Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|