Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reading From An INI File
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00664506
Message ID:
00665116
Vues:
17
This is what we use in our program, and its been working fine so far. Not sure about the difference (if there is any) between kernel31 and win32API.



DECLARE INTEGER GetPrivateProfileString IN Win32API AS GetPrivStr
String cSection,;
String cKey,;
String cDefault,;
String @cBuffer,;
Integer nBufferSize,;
String cINIFile

Used like this:

lcBuffer = space(10) + CHR(0)
if GetPrivStr("TechWare LogBook", "INIUpDate", "", @lcBuffer, LEN(lcBuffer), CURDIR() + INIFILE) > 0
llIniUpDate = iif(upper(alltrim(strtran(lcBuffer,chr(0),' '))) = 'YES', .t., .f.)

matt, whose finally been able to answer a question, instead of posting one!

>Whats wrong here? I'm getting a data type mismatch error.
>
>LOCAL sRetVal, nSize, sReturn, nResult
>sRetVal = ""
>nSize = 254
>sReturn = SPACE(nSize)
>
>DECLARE INTEGER GetPrivateProfileString IN kernel32;
>STRING lpAppName,;
>INTEGER lpKeyName,;
>STRING lpDefault,;
>STRING @sReturn,;
>INTEGER nSize,;
>STRING lpFileName
>
>nResult = GetPrivateProfileString(sSectionName, sKeyName,;
>(#novalue#)", @sReturn, nSize, sFileName)
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform