[REBOL] Problems with accessing external lib in /Command
From: coussement:c:itc:mil:be at: 6-Mar-2001 14:01
Hi fellow Rebolians:
Because I need to use the user name in an NT-networking env, I thought to
use the "GetUserNameA" function from from ADVAPI32.dll ...
Based on the code found on MSDN at
http://support.microsoft.com/support/kb/articles/Q152/9/70.asp , I tried:
name: make string! 255
len: make integer! 255
advapi32: load/library %advapi32.dll
get-user-name: make routine! [buffer [string!] length [integer!] return:
[integer!]] advapi32 "GetUserNameA"
get-user-name name len
print name ; because the returned value should be here
But, although I tried several different combinations of passed parms,
/Command stays crashing.
Well, what did I do wrong ? Anybody as any experience regarding this matter
Thanks for answering and Best Regards,