🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
6 messages
6 total messages Started by Randel Bjorkquist Thu, 08 May 2003 19:15
User Name?
#16603
Author: Randel Bjorkquist
Date: Thu, 08 May 2003 19:15
11 lines
1269 bytes
Hi all,

I'm trying to get the full user name, not just the logged in name.  I have
looked into the LookupAccountName function, but am having some problems
understand what I'm all supposed to do.  Is there a way to get the name the
user is logged in as and then go get their full system information, like
first/last name?

Thanks in advance,

Randel Bjorkquist
Re: User Name?
#16605
Author: Remy Lebeau (TeamB)
Date: Thu, 08 May 2003 20:11
14 lines
1279 bytes
"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
Re: User Name?
#16615
Author: Randel Bjorkquist
Date: Fri, 09 May 2003 13:24
63 lines
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
>
>
Re: User Name?
#16616
Author: Randel Bjorkquist
Date: Fri, 09 May 2003 13:51
84 lines
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
> >
> >
>
>
>
Re: User Name?
#16619
Author: Randel Bjorkquist
Date: Fri, 09 May 2003 15:24
101 lines
3572 bytes
Hey Remy,

One of the guys I work with and I finally got it to work.  So no need for
the example.  Thanks again for your help.

Randel Bjorkquist


"Randel Bjorkquist" <rbjorkquist@coilcraft.com> wrote in message
news:3ebbb25c$1@newsgroups.borland.com...
> 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
> > >
> > >
> >
> >
> >
>
>
Re: User Name?
#16622
Author: Remy Lebeau (TeamB)
Date: Fri, 09 May 2003 16:04
15 lines
1375 bytes
"Randel Bjorkquist" <rbjorkquist@coilcraft.com> wrote in message
news:3ebbabef$1@newsgroups.borland.com...

> 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.

You probably did not include the header file for it:

    #include <lmaccess.h>


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