Thread overview
implementing timer events
Jan 02, 2007
Lee
Jan 02, 2007
Lee
January 02, 2007
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
January 02, 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
January 02, 2007
Thanks. Simply adding an extern statement and a function prototype seems to have resolved the problem.

Lee