Alaska Software Inc. - alternative for NnetWhoAmI()
Username: Password:
AuthorTopic: alternative for NnetWhoAmI()
Jayalternative for NnetWhoAmI()
on Wed, 23 Nov 2011 11:06:37 -0300
Good day everybody,

We are now busy conferting the existing applications ,which were running on 
a Novell Netware server, to be able to run on a Microsoft server. One of the 
changes I made to the apps is remove all XBTtool-functions. One of those 
functions is "NnetWhoAmI()". Is there an alternative function which I can 
use in the microsoft environment?

Best regards;

Jay
Victor ShepelevRe: alternative for NnetWhoAmI()
on Tue, 29 Nov 2011 14:01:57 +0400
func xw32_GetUserName()
local nDll,cRetVal:=space(256),nSize:=255
nDll:=DllLoad("ADVAPI32.DLL")
if nDll<>0
    DllCall(nDll,DLL_STDCALL,"GetUserNameA",@cRetVal,@nSize)
    DllUnload(nDll)
    cRetVal:=convToOemCP(remall(strtran(cRetVal,chr(0),'')))
else
    cRetVal:='Error'
endif
return(cRetVal)


Victor Shepelev