Saludos...
Estas definiendo la función externa?
Define la variable que da longitud como long (tu la estas definiendo entero corto sin signo)...
Aquí tienes ejemplos de las dos cosas...
GetComputerNameA( )
This function returns the computer's name into a string by reference. Be sure to allocate enough space for the string or you'll get a GPF when you exit PowerBuilder. There is no PowerBuilder equivalent.
Global External Function:
FUNCTION boolean GetComputerNameA(ref string cname,ref long nbuf) LIBRARY "Kernel32.dll"
Script:
string ls_compname
long ll_buf
ll_buf = 25
ls_compname = space(ll_buf)
GetComputerNameA(ls_compname, ll_buf)
MessageBox("Computer name is:", ls_compname)
GetUserNameA( )
This function returns the current users logon name. Be sure to allocate enough space for the string or you'll get a GPF when you exit PowerBuilder. There is no PowerBuilder equivalent.
Global External Function:
FUNCTION boolean GetUserNameA(ref string uname, ref ulong slength) LIBRARY "ADVAPI32.DLL"
Script:
string ls_username
string ls_var
ulong lu_val
boolean rtn
lu_val = 255
ls_username = Space( 255 )
rtn = GetUserNameA(ls_username, lu_val)
Messagebox("GetUserNameA", "Username = " + string(ls_username))
Para mas información de funciones del windows que puedes utilizar entra con este link...
http://www.ikarhomecenter.ru/index.php?p=p...etComputerNameA