Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GetUserName
Message
 
 
À
18/05/1999 21:06:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Divers
Thread ID:
00220265
Message ID:
00220273
Vues:
33
Steve,

You need to add an @ in the declare to tell it the string argument is passed by reference. Also the second argument tells the api how big the buffer is:
BOOL GetUserName(
  LPTSTR lpBuffer,  // address of name buffer
  LPDWORD nSize     // address of size of name buffer
);
 

declare GetUserName in win32api string @ sBuffer, integer @ nSize
UserName = space(25)
nSize = len( UserName )
GetUserName( @UserName, @nSize )
>Hi there,
>
>I was trying to use GetUserName call from win32api and all I got in return was a blank space. Can someone help me out with the code?
>
>In the init() event
>
>Declare GetUserName in Win32api string, integer
>
>UserName = space(25)
>
>=GetUserName( @UserName, 1 )
>
>Return blank. Why?
>
>Thanks
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform