Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
API Call Not Working
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00672210
Message ID:
00672270
Views:
15
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform