Article View: borland.public.cppbuilder.nativeapi
Article #16616Re: User Name?
From: Randel Bjorkquist
Date: Fri, 09 May 2003 13:51
Date: Fri, 09 May 2003 13:51
84 lines
3096 bytes
3096 bytes
Hey Remy,
Ok...I got it to compile. Well not without errors, but at least I got it to
recognize the "NetUserGetInfo()" function. Can you give me a simple example
of what I need to get it to work?
Thanks for the help,
Randel
"Randel Bjorkquist" <rbjorkquist@coilcraft.com> wrote in message
news:3ebbabef$1@newsgroups.borland.com...
> 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:
<3ebbb25c$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!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> <3ebbabef$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:59:10 PST From: "Randel Bjorkquist" <rbjorkquist@coilcraft.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3ebaacee$1@newsgroups.borland.com> <3ebab986$1@newsgroups.borland.com> <3ebbabef$1@newsgroups.borland.com> Subject: Re: User Name? Date: Fri, 9 May 2003 08:51:25 -0500 Lines: 86 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: <3ebbb25c$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1052488284 209.172.185.194 (9 May 2003 06:51:24 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail