www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - implementing timer events

reply Lee <llee goucher.edu> writes:
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
Jan 01 2007
parent reply Chris Nicholson-Sauls <ibisbasenji gmail.com> writes:
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
Jan 01 2007
parent Lee <llee goucher.edu> writes:
Thanks. Simply adding an extern statement and a function prototype
seems to have resolved the problem.

Lee
Jan 01 2007