Solved

visual c++ compile error

Posted on 2004-03-29
9
372 Views
Last Modified: 2013-11-20
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!
0
Comment
Question by:missdong
9 Comments
 
LVL 15

Accepted Solution

by:
lakshman_ce earned 75 total points
ID: 10709540
Try adding
#include <windows.h>
in your VideoDisplay.cpp file

-Lakshman
0
 
LVL 10

Expert Comment

by:Mercantilum
ID: 10709552
0
 
LVL 14

Expert Comment

by:wayside
ID: 10713697
SM_REMOTESESSION is defined in WinUser.h, which is in the platform SDK :

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

...
#endif /* WINVER >= 0x0500 */
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 15

Expert Comment

by:lakshman_ce
ID: 10713786
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
 

Expert Comment

by:dong9968
ID: 11857242
Thanks for all the help, now it works after I include windows.h in my cpp fie.

shiming
0
 

Expert Comment

by:dong9968
ID: 12006543
Thanks. Please close this question. It is solved
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now