Skip to main content
gamedev.net
🔒 Locked

CreateWaitableTimer()

Started by NewtonApple 1 reply 1.3k views
Original Post
NewtonApple
NewtonApple
Hi there, I''m working on something where I need to create a waitable timer event to be used in conjunction of winsock overlapped i/o. I''m running Windows XP home edition. for some reason when i tried to set it up using CreateWaitableTimer() in VC++ 6.0 (same result in Visual Studio.Net), it complained that there''s no such function: "error C2065: ''CreateWaitableTimer'' : undeclared identifier." The code i use is as follow: Handel waitEvents = CreateWaitableTimer(NULL, TRUE, "WaitableTimer"); I even tried to compile the code from (link below) MSDN and it still won''t work... if someone knows the reason why this is so please let me know. Thanks in advance.. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/using_waitable_timer_objects.asp
Martee
Martee
Did you define _WIN32_WINNT?

From MSDN:
quote:

To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0400 or later. For more information, see Using the SDK Headers.

ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
NewtonApple
NewtonApple
Hm.. when i "#define _WIN32_WINNT 0x0501" it seems to block off winsock2.h. this happens when i define it before winsock2.h; it doesn't seem to work if i define it after that... -__- i'm not very familiar with the whole win32 linking mechanism.. all i want is to use a WaitableTimer in my simple console program.. so if anyone care to explain a little.. my ears are all urs.. oh.. im and linking ws2_32.lib..

[edited by - NewtonApple on February 23, 2003 2:57:43 AM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.