Windows API Calls for Powerbuilder 5.0

¹®Á¦

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)

 

ÂüÁ¶