Solved

visual c++ compile error

Posted on 2004-03-29
9
377 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
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!

 
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

Suggested Solutions

Title # Comments Views Activity
MFC Dialog 9 52
Complete beginner needs help making a cron job 9 129
Window placement 17 94
mapAB Challlenge 35 171
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

685 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