Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
H

Hummer2097

@Hummer2097
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • TimerAPCProc() Not Being Called With SetWaitableTimer()
    H Hummer2097

    Thanks for the reply and information. The timer is being created in the main thread so it's definitely not a problem of it exiting too soon. I also tried setting the time to -1 just to try and get it to call the TimerAPCProc but still it wouldn't. I solved the problem by switching to SetTimer(). For some reason I thought SetTimer() worked in seconds rather than milliseconds and that's the only reason I was using SetWaitableTimer(). I was looking for an alternative time and noticed SetTimer() took a value in milliseconds so it was fine for what I needed. I still don't understand why SetWaitableTimer() wouldn't work but it doesn't really matter now.

    C / C++ / MFC help question

  • TimerAPCProc() Not Being Called With SetWaitableTimer()
    H Hummer2097

    I wrote the below code in an attempt to set a 500ms timer. CreateWaitableTimer returns a valid handle and SetWaitableTimer() returns 1 indicating success, however TimerAPCProc() never gets called. Can anybody see what's wrong with this code? VOID CALLBACK __stdcall TimerAPCProc(LPVOID lpArgToCompletionRoutine, DWORD dwTimerLowValue, DWORD dwTimerHighValue) { } void SetTimer() { m_hTimer = CreateWaitableTimer(NULL, false, NULL); LARGE_INTEGER liInterval; liInterval.QuadPart = -500000000; int dSuccess = SetWaitableTimer(m_hTimer, &liInterval, 0, TimerAPCProc, NULL, false); } Thanks for any help you can offer.

    C / C++ / MFC help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups