k***@gmail.com
2007-06-06 01:02:22 UTC
I'm trying out some of the sample code on Raymond Chen's blog:
http://blogs.msdn.com/oldnewthing/archive/2003/08/29/54728.aspx
Unfortunately I can't get the following snippet of code to compile:
void OnPaint(HWND hwnd)
{
PAINTSTRUCT ps;
BeginPaint(hwnd, &ps);
if (!IsRectEmpty(&ps.rcPaint))
{
// compute time to next update - we update once a second
SYSTEMTIME st;
GetSystemTime(&st);
DWORD dwTimeToNextTick = 1000 - st.wMilliseconds;
SetTimer(hwnd, 1, dwTimeToNextTick,
InvalidateAndKillTimer);
}
PaintContent(hwnd,&ps);
EndPaint(hwnd, &ps);
}
Here is the compiler output:
error C2275: 'DWORD' : illegal use of this type as an expression see
declaration of 'DWORD'
error C2146: syntax error : missing ';' before identifier
'dwTimeToNextTick'
error C2065: 'dwTimeToNextTick' : undeclared identifier
I'm using the Win32 project template in VS 2005.
Any ideas?
-Thx
http://blogs.msdn.com/oldnewthing/archive/2003/08/29/54728.aspx
Unfortunately I can't get the following snippet of code to compile:
void OnPaint(HWND hwnd)
{
PAINTSTRUCT ps;
BeginPaint(hwnd, &ps);
if (!IsRectEmpty(&ps.rcPaint))
{
// compute time to next update - we update once a second
SYSTEMTIME st;
GetSystemTime(&st);
DWORD dwTimeToNextTick = 1000 - st.wMilliseconds;
SetTimer(hwnd, 1, dwTimeToNextTick,
InvalidateAndKillTimer);
}
PaintContent(hwnd,&ps);
EndPaint(hwnd, &ps);
}
Here is the compiler output:
error C2275: 'DWORD' : illegal use of this type as an expression see
declaration of 'DWORD'
error C2146: syntax error : missing ';' before identifier
'dwTimeToNextTick'
error C2065: 'dwTimeToNextTick' : undeclared identifier
I'm using the Win32 project template in VS 2005.
Any ideas?
-Thx