implementing timer events

Chris Nicholson-Sauls ibisbasenji at gmail.com
Mon Jan 1 19:41:04 PST 2007


Lee wrote:
> I am working on a small application for windows that updates its
> client window every 30 milliseconds. I tried to do this using the
> SetTimer function defined in the windows API. Unfortunately
> however, the compiler generates an error, every time it encounters
> the function call ("Error: undefined identifier SetTimer"). I
> tried compiling with the gdi32.lib included along with the
> basic .def file given in the winsamp example. I attached a copy of
> the source code. Any assistance would be appreciated. Thanks in
> advance.
> Lee

SetTimer is provided by user32.dll/User32.lib so make certain you are linking with that 
(should be by default though, I believe).  Also, you may need to include an extern 
decleration for it, as the Win32 API declerations in Phobos are incomplete.  (You can look 
through dsource.org for other Win32 offerings, and there's always Tango once it goes 
public.  Although, honestly, I don't really know the state of its Win32 API either.)

-- Chris Nicholson-Sauls


More information about the Digitalmars-d-learn mailing list