Thread View: borland.public.cppbuilder.nativeapi
7 messages
7 total messages
Started by Mike Collins
Fri, 18 Apr 2008 15:29
Still having problems linking to WTSQueryUserToken & CreateEnvironmentBlock
Author: Mike Collins
Date: Fri, 18 Apr 2008 15:29
Date: Fri, 18 Apr 2008 15:29
13 lines
1484 bytes
1484 bytes
Sorry to pester again, only posted yesterday. Still having problems linking to CreateEnvironmentBlock & WTSQueryUserToken. I resolved my other problem by re-defining _WIN32_WINNT, but this doesn't seem to fix the linking problem with the above api's. I've included both header files, WtsApi32.h and Userenv.h and the IDE seems to locate the functions (if i use CTRL and click on the function name, it resolves it to the correct header). But when i compile, i still get "Unresolved External" error. Does anyone have any other ideas before i start dynamically loading them? Mike C
Re: Still having problems linking to WTSQueryUserToken & CreateEnvironmentBlock
Author: Chris F
Date: Fri, 18 Apr 2008 14:53
Date: Fri, 18 Apr 2008 14:53
5 lines
1058 bytes
1058 bytes
Don't suppose you have to manually include the lib in the project do you? Just a thought. Chris F
Re: Still having problems linking to WTSQueryUserToken & CreateEnvironmentBlock
Author: Chris F
Date: Fri, 18 Apr 2008 14:57
Date: Fri, 18 Apr 2008 14:57
9 lines
1150 bytes
1150 bytes
Very long shot but, I had an issue like this because I had accidentally removed all the exports from the import32 using libexportremover. Again, just a thought. Best regards Chris F
Re: Still having problems linking to WTSQueryUserToken & CreateEnvironmentBlock
Author: Bob Gonder
Date: Fri, 18 Apr 2008 15:48
Date: Fri, 18 Apr 2008 15:48
6 lines
1172 bytes
1172 bytes
Chris F wrote: >Don't suppose you have to manually include the lib in the project do you? Yes. Not many apps use that, so it isn't automatic.
Re: Still having problems linking to WTSQueryUserToken & CreateEnvironmentBlock
Author: Remy Lebeau (TeamB)
Date: Fri, 18 Apr 2008 16:35
Date: Fri, 18 Apr 2008 16:35
19 lines
1562 bytes
1562 bytes
"Mike Collins" <its@TheBottomOfThePost> wrote in message news:4808addc@newsgroups.borland.com... > Still having problems linking to CreateEnvironmentBlock & > WTSQueryUserToken. I resolved my other problem by re-defining > _WIN32_WINNT, but this doesn't seem to fix the linking problem > with the above api's. That only addresses the *compiler*. Not you have to address the *linker*. Those are handled separately. > But when i compile, i still get "Unresolved External" error. You did not add the relevant .lib files to your project - userenv.lib and wtsapi32.lib. Gambit
Re: Still having problems linking to WTSQueryUserToken & CreateEnvironmentBlock
Author: Remy Lebeau (TeamB)
Date: Fri, 18 Apr 2008 23:53
Date: Fri, 18 Apr 2008 23:53
12 lines
1410 bytes
1410 bytes
"Mike Collins" <its@TheBottomOfThePost> wrote in message news:4809333a@newsgroups.borland.com... > I'm being a nugget - i'm assuming that because the function appears > in the header, then it must be accessible. To the compiler, yes. Not to the linker. You need import .lib files for that. Gambit
Re: Still having problems linking to WTSQueryUserToken & CreateEnvironmentBlock
Author: Mike Collins
Date: Sat, 19 Apr 2008 00:58
Date: Sat, 19 Apr 2008 00:58
12 lines
1253 bytes
1253 bytes
I'm being a nugget - i'm assuming that because the function appears in the header, then it must be accessible. No, I hadn't included the lib files, i've just used LoadLibrary / GetProcAddress instead - all seems to work - which is a very refreshing change. Cheers Mike C "Remy
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