Information générale
Catégorie:
Fonctions Windows API
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement