Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PB 11.5 GetUserNameW() function only one (first) character of user name

494 views
Skip to first unread message

Pritesh

unread,
May 18, 2009, 8:19:14 AM5/18/09
to
GetUserNameW() function only one (first) character of user
name.
It works fine with PB9 & earlier versions.
Please advise.

Pritesh

unread,
May 18, 2009, 8:53:51 AM5/18/09
to


ulong lul_size = 255
string ls_name
ls_name = space(lul_size)
lb_rc = GetUserNameW( ls_name, lul_size)

This code gives only first character of user name in
'ls_name' (PB 11.5).

Chris Werner

unread,
May 18, 2009, 9:08:58 AM5/18/09
to
Show us the external function declaration for GetUserNameW()


<Pritesh> schrieb im Newsbeitrag news:4a1149b5.3ac...@sybase.com...

Chris Werner

unread,
May 18, 2009, 9:48:18 AM5/18/09
to
Remove ;Ansi from the definition


<Pritesh> schrieb im Newsbeitrag news:4a11541d.430...@sybase.com...
> function boolean GetUserNameW(ref string lpBuffer, ref
> ulong nSize) library "ADVAPI32.DLL" alias for
> "GetUserNameW;Ansi"

Pritesh

unread,
May 18, 2009, 9:38:14 AM5/18/09
to
function boolean GetUserNameW(ref string lpBuffer, ref
ulong nSize) library "ADVAPI32.DLL" alias for
"GetUserNameW;Ansi"

Maarten_deme

unread,
May 18, 2009, 10:18:05 AM5/18/09
to
FUNCTION BOOLEAN GetUserNameA (ref String userID, REF ULong len )
LIBRARY "ADVAPI32.DLL" ALIAS FOR "GetUserNameW"


i use this in powerbuilder 11.2 i hope this helps ;)

Maarten_deme

unread,
May 18, 2009, 10:28:55 AM5/18/09
to
little more additional code


//function to get the user name

string ls_username
ulong lul_size

ls_username = fill( ' ', 255 )
lul_size = 255

GetUserNameA( ls_username, lul_size)

return ls_username

//function end

Pritesh

unread,
May 18, 2009, 9:24:54 AM5/18/09
to
Thanks a lot guys for all your help!!!

Cheers,
Pritesh

0 new messages