Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Undeclared Identifier in an ATL project - what am I doing wrong?

0 views
Skip to first unread message

Alex K. Angelopoulos (MVP)

unread,
May 16, 2002, 10:38:11 PM5/16/02
to
Ok, what am I missing?

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

David Lowndes

unread,
May 17, 2002, 4:03:49 AM5/17/02
to
>// Actual error message I get is - Data.cpp(14) : error C2065:
>'SM_REMOTESESSION' : undeclared identifier
>
>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

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.

Alex K. Angelopoulos (MVP)

unread,
May 20, 2002, 9:08:15 AM5/20/02
to
No, I had *not*. Thanks, David.
one more basic key fact about VC++ down, 9999 to go...

"David Lowndes" <dav...@mvps.org> wrote in message
news:38e9eu4525du1uapl...@4ax.com...

0 new messages