Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

visual c++ compile error

Posted on 2004-03-29
9
Medium Priority
?
381 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
6 Comments
 
LVL 15

Accepted Solution

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

-Lakshman
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Integration Management Part 2

783 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