Board index » cppbuilder » Novell Netware - Can anyone help!!

Novell Netware - Can anyone help!!

Hello,

I've been trying to put together a program which will pull off the user
name of whoever is using the computer it is run on (using Novell NetWare

4).  I have downloaded the Novell SDK and have all the appropriate
headers.  I'm using the functions GetConnectionNumber and
GetConnectionInformation, I have declared these and surrounded the
declaration with extern "C" and have then used the functions properly
later on.  The source file now properly compiles but I get the linker
errors "Unresolved external '_GetConnectionInformation' referenced from
C:\BUILDER_C++\DFL\DFL.OBJ." and the same for _GetConnectionNumber.

HELP _ PLEASE!!

Matt Duffy

 

Re:Novell Netware - Can anyone help!!


Hi, Matt.

The following works for me on a Novell network:

//---------------------------------------------------------------------------
AnsiString GetNetUser(void)
{
        AnsiString retVal("Anonymous");
        char *user = 0;
        DWORD len = 0;

        ::WNetGetUser(NULL, user, &len);
        user = new char[(int) (len + 1)];
        if (::WNetGetUser(NULL, user, &len) == NO_ERROR) retVal = user;
        delete[] user;

        return retVal;

Quote
}

//---------------------------------------------------------------------------

Granted, it is not a Novell call.  I can give you Bindery and NDS code
(home-grown and ugly) to do the same thing, but the MS API above gives
the right results in my experience.

HTH.

robert

Quote
Matt Duffy wrote:

> Hello,

> I've been trying to put together a program which will pull off the user
> name of whoever is using the computer it is run on (using Novell NetWare

> 4).  I have downloaded the Novell SDK and have all the appropriate
> headers.  I'm using the functions GetConnectionNumber and
> GetConnectionInformation, I have declared these and surrounded the
> declaration with extern "C" and have then used the functions properly
> later on.  The source file now properly compiles but I get the linker
> errors "Unresolved external '_GetConnectionInformation' referenced from
> C:\BUILDER_C++\DFL\DFL.OBJ." and the same for _GetConnectionNumber.

> HELP _ PLEASE!!

> Matt Duffy

Re:Novell Netware - Can anyone help!!


Thanks that's great!

I can't believe I spent so much time messing around with those Netware C
functions when I could have done it like that.  I would be very interested in
seeing the NDS code though if you get a chance

Cheers

Matt

Quote
Robert Dunn wrote:
> Hi, Matt.

> The following works for me on a Novell network:

> //---------------------------------------------------------------------------
> AnsiString GetNetUser(void)
> {
>         AnsiString retVal("Anonymous");
>         char *user = 0;
>         DWORD len = 0;

>         ::WNetGetUser(NULL, user, &len);
>         user = new char[(int) (len + 1)];
>         if (::WNetGetUser(NULL, user, &len) == NO_ERROR) retVal = user;
>         delete[] user;

>         return retVal;
> }
> //---------------------------------------------------------------------------

> Granted, it is not a Novell call.  I can give you Bindery and NDS code
> (home-grown and ugly) to do the same thing, but the MS API above gives
> the right results in my experience.

> HTH.

> robert

> Matt Duffy wrote:

> > Hello,

> > I've been trying to put together a program which will pull off the user
> > name of whoever is using the computer it is run on (using Novell NetWare

> > 4).  I have downloaded the Novell SDK and have all the appropriate
> > headers.  I'm using the functions GetConnectionNumber and
> > GetConnectionInformation, I have declared these and surrounded the
> > declaration with extern "C" and have then used the functions properly
> > later on.  The source file now properly compiles but I get the linker
> > errors "Unresolved external '_GetConnectionInformation' referenced from
> > C:\BUILDER_C++\DFL\DFL.OBJ." and the same for _GetConnectionNumber.

> > HELP _ PLEASE!!

> > Matt Duffy

Other Threads