visual c++ compile error

When I tried to compile a visual c++ project, I loaded the .dsw file and build it. But it always gave me the error:

Compiling...
VideoDisplay.cpp
C:\shiming\VirtualDub\sourcecode\VirtualDub\source\VideoDisplay.cpp(54) : error C2065: 'SM_REMOTESESSION' : undeclared identifier
C:\shiming\VirtualDub\sourcecode\VirtualDub\source\VideoDisplay.cpp(167) : error C2065: 'GetWindowLongPtr' : undeclared identifier
 ...

I mean, it didn't told me that it could not find the header file. But I think 'SM_REMOTESESSION' is defined by MSDN header. I downloaded SDK. I don't know what's the reason.

Anyone can help?

Thank you!
missdongAsked:
Who is Participating?
 
lakshman_ceConnect With a Mentor Commented:
Try adding
#include <windows.h>
in your VideoDisplay.cpp file

-Lakshman
0
 
waysideCommented:
SM_REMOTESESSION is defined in WinUser.h, which is in the platform SDK :

#if(WINVER >= 0x0500)
#define SM_REMOTESESSION        0x1000

...
#endif /* WINVER >= 0x0500 */
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
lakshman_ceCommented:
In msdn you will find
Header: Declared in Winuser.h; include Windows.h.
means we just need to include Windows.h
For e.g you can have a look at the link,
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getsystemmetrics.asp


-Lakshman
0
 
dong9968Commented:
Thanks for all the help, now it works after I include windows.h in my cpp fie.

shiming
0
 
dong9968Commented:
Thanks. Please close this question. It is solved
0
All Courses

From novice to tech pro — start learning today.