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
begin 644 D_windows_timer.txt
M+R\ 87!P;&EC871I;VX 9&5M;VYS=')A=&5S('1H92!T:6UE<B!E=F5N="!F
M=6YC=&EO;BX-" T*+R\ ;F]T93H =VEN9&]W<R!D871A('1Y<&5S(&%R92!C
M87-E('-E;G-I=&EV90T*+R\ ;F]T93H 8V]M<&EL92!B>2!T>7!I;F<[(`T*






M;G0 5VEN9&]W4')O8R`H2%=.1"!H5VYD+"!U:6YT(&US9RP 5U!!4D%-('=0

M8V%S90E735]004E.5#H-

M5%)50U0)<',["0D)"0DO+R!S<&5C:69I97, <F5G:6]N('1O(&)E(')E9')A













M4T<)"6US9SL-" E(5TY$"0EH5VYD.PT*"5=.1$-,05-3"7=C.PT*"4A)3E-4




M4')O8SL-" EW8RYH26YS=&%N8V4)/2!H26YS=#L-" EW8RYH26-O; D)/2!,




M>DUE;G5.86UE"3T ;G5L;#L-" EW8RYC8D-L<T5X=')A"3T ,#L-" EW8RYC
M8E=N9$5X=')A"3T ,#L-
M<D-L87-S02`H)G=C*3L-" EH5VYD"3T 0W)E871E5VEN9&]W02`-" DH(`T*









M<FX ,3L-"GT-" T*97AT97)N("A7:6YD;W=S*0T*:6YT(%=I;DUA:6X-"B -

M;F-E+`T*"4Q04U12(&QP0VUD3&EN92P-" EI;G0 ;D-M9%-H;W<-"BD-"GL-

M9V%R8F%G92!C;VQL96-T;W(-" E?;6EN:70 (" I.PD)+R\ :6YI=&EA;&EZ
M92!M;V1U;&4 8V]N<W1R=6-T;W(-" T*"71R>0T*"7L-" D)7VUO9'5L94-T

M;FET5&5S=',)*"D["2\O(')U;B!U;FET('1E<W1S("AO<'1I;VYA;"D-" T*

M8V  *$]B:F5C="!O*0D)"2\O(&-A=&-H(&%N>2!U;F-A=6=H="!E>&-E<'1I



M<F5S=6QT"3T ,#L)"2\O(&9A:6QE9`T*"7T-" T*"6=C7W1E<FT *"D["0DO

%=#L-"GT`
`
end
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