Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
API Call Not Working
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00672210
Message ID:
00672270
Vues:
14
This function returns null terminated string in the buffer. There's no guaranty that the rest of the buffer not filled with a junk. Try
*sReturn = STRTRAN(sReturn, CHR(0), "")
sReturn = LEFT(sReturn, lRetVal)
>This function returns empty on Win98 PC's. Works fine on
>Win2000.
>
>
>
>DECLARE INTEGER GetPrivateProfileString IN kernel32;
>  STRING   @sAppName,;
>  STRING   @sKeyName,;
>  STRING   @sDefault,;
>  STRING   @sReturn,;
>  INTEGER  @nSize,;
>  STRING   @sFileName
>
>sFileName = LOWER(GETFILE())
>sSection  = "Application"
>sKeyName  = "Top"
>sDefault  = "(#default#)"	&& Return "(#default#)" if value is not found
>iSize	  = 255			&& Size of the string
>sReturn	  = SPACE(iSize)	&& String to contain the returned value
>
>lRetVal = GetPrivateProfileString(@sSection, @sKeyName, @sDefault,;
>		@sReturn, @iSize, @sFileName)
>
>sReturn = STRTRAN(sReturn, CHR(0), "")
>
>MESSAGEBOX(TRANSFORM(lRetVal))
>MESSAGEBOX(sReturn)
>
>RETURN
>
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform