Article View: borland.public.cppbuilder.nativeapi
Article #16615Re: User Name?
From: Randel Bjorkquist
Date: Fri, 09 May 2003 13:24
Date: Fri, 09 May 2003 13:24
63 lines
2569 bytes
2569 bytes
Hey Remy,
I am trying your suggestion, but am getting the compiler error "[C++ Error]
Main.cpp(71): E2268 Call to undefined function 'NetUserGetInfo'". I do not
see what I'm missing. The GetUserName() function is working just fine.
I just don't get it. do you have any suggestions?
Randel
APP HEADER FILE
//--------------------------------------------------------------------------
-
:
UCHAR lpszUserName[250];
DWORD dwUserNameLength;
:
APP SOURCE CODE
//--------------------------------------------------------------------------
-
__fastcall Tfrm_Main::Tfrm_Main(TComponent* Owner) : TForm(Owner)
{
:
//User name variables
dwUserNameLength = 250;
:
}//end of "Tfrm_Main::Tfrm_Main" method - DEFAULT CONSTRUCTOR
//--------------------------------------------------------------------------
-
bool Tfrm_Main::GetAccountInfo(void)
{
bool LookupErr;
:
GetUserName(lpszUserName, &dwUserNameLength);
LPBYTE* bufptr;
NetUserGetInfo((LPWSTR)NULL, lpszUserName, 2, bufptr);
:
return(!LookupErr);
}//end of "Tfrm_Main::GetAccountInfo" method
"Remy Lebeau (TeamB)" <gambit47@yahoo.com> wrote in message
news:3ebab986$1@newsgroups.borland.com...
>
> "Randel Bjorkquist" <rbjorkquist@coilcraft.com> wrote in message
> news:3ebaacee$1@newsgroups.borland.com...
>
> > Is there a way to get the name the user is logged in as
>
> GetUserName().
>
> > and then go get their full system information, like first/last name?
>
> NetUserGetInfo() with the dwLevel parameter set to 2 or higher.
>
>
> Gambit
>
>
Technical Details
Message-ID:
<3ebbabef$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3ebaacee$1@newsgroups.borland.com> <3ebab986$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,390cdc0a29186e7a X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-05-09 06:32:04 PST From: "Randel Bjorkquist" <rbjorkquist@coilcraft.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3ebaacee$1@newsgroups.borland.com> <3ebab986$1@newsgroups.borland.com> Subject: Re: User Name? Date: Fri, 9 May 2003 08:24:00 -0500 Lines: 66 Organization: Coilcraft, Inc. X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 209.172.185.194 Message-ID: <3ebbabef$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1052486639 209.172.185.194 (9 May 2003 06:23:59 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail