🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
4 messages
4 total messages Started by Jeff Tue, 22 May 2007 20:07
Active Console Session
#1978
Author: Jeff
Date: Tue, 22 May 2007 20:07
8 lines
1268 bytes
I'm working with a system service that I've built and am attempting to use 
WTSGetActiveConsoleSessionId() to get the session ID of the currently active 
terminal services session.  When I go to compile my program in BCB6, it 
says, "Call to undefined function'WTSGetActiveConsoleSessionId'"  The 
function is prototyped in winbase.h, why is my compilation failing?

Thanks,
Jeff 
Re: Active Console Session
#1979
Author: Remy Lebeau (TeamB)
Date: Tue, 22 May 2007 21:51
32 lines
1604 bytes
"Jeff" <Jeff@nospam.com> wrote in message
news:46534dba$1@newsgroups.borland.com...

> The function is prototyped in winbase.h, why is my compilation
failing?

Look more carefully at winbase.h.  WTSGetActiveConsoleSessionId() is
wrapped in an #if statement:

    #if _WIN32_WINNT >= 0x0501

    WINBASEAPI
    DWORD
    WINAPI
    WTSGetActiveConsoleSessionId();

    WINBASEAPI
    BOOL
    WINAPI
    IsWow64Process(
    HANDLE hProcess,
    PBOOL Wow64Process
    );

    #endif // (_WIN32_WINNT >= 0x0501)

_WIN32_WINNT is set by winresrc.h to 0x0500 by default in BCB 6.  You
can override it in the "Conditionals" field of the Project Options.


Gambit
Re: Active Console Session
#1980
Author: Jeff
Date: Tue, 22 May 2007 22:06
6 lines
1308 bytes
> _WIN32_WINNT is set by winresrc.h to 0x0500 by default in BCB 6.  You
> can override it in the "Conditionals" field of the Project Options.

OK, I put "_WIN32_WINNT = 0x0501" in the Conditionals section of Project 
Options, but it errors out with, "Incorrect project override" on the equal 
sign and number. Please help. 
Re: Active Console Session
#1981
Author: Remy Lebeau (TeamB)
Date: Tue, 22 May 2007 23:10
15 lines
1410 bytes
"Jeff" <Jeff@nospam.com> wrote in message
news:465369a1$1@newsgroups.borland.com...

> OK, I put "_WIN32_WINNT = 0x0501" in the Conditionals
> section of Project Options, but it errors out with, "Incorrect
> project override" on the equal sign and number. Please help.

Don't use spaces in that field.  That field is ultimately passed to
the compiler via the command-line, where spaces are used to delimit
separate parameters.  "=" and "0x0501" by themselves are not valid
parameters for the compiler.


Gambit
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads