I just tried to put together my first simple ATL project. All it does is return
a property value for the current user session, indicating whether it is being
run in a Terminal Services 2000 or higher remote session . I get an undeclared
identifier error on the line
return GetSystemMetrics( SM_REMOTESESSION );
I did a very basic setup on this, only created 1 property, and SM_REMOTESESSION
is defined in "winuser.h". If it makes any difference:
(1) The ref to SM_REMOTESESSION in winuser.h is this:
#if(WINVER >= 0x0500)
#define SM_REMOTESESSION 0x1000
(2) I'm compiling on XP Pro, running VC++6 Enterprise
// CODE BELOW THIS LINE
// Data.cpp : Implementation of CData
#include "stdafx.h"
#include "Wtsc.h"
#include "Data.h"
#include "winuser.h"
/////////////////////////////////////////////////////////////////////////////
// CData
STDMETHODIMP CData::get_IsInTSSession(BOOL *pVal)
{
return GetSystemMetrics( SM_REMOTESESSION );
}
// Actual error message I get is - Data.cpp(14) : error C2065:
'SM_REMOTESESSION' : undeclared identifier
Have you actually set WINVER=0x0500 for your project?
Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.
"David Lowndes" <dav...@mvps.org> wrote in message
news:38e9eu4525du1uapl...@4ax.com...