Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
NT4 API GetPrivateProfileString vs Win95 Help!
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00038058
Message ID:
00038098
Vues:
36
>Yech!
>
>I've developed my app in NT, using Get/WritePrivateProfileString and it work fine there, but when I try to run it in 95, it craps out. MSDN tells of some subtle differences in the GetProfileString in the API's of NT 4 and Win95, but does not get specific.
>
>What I'd like to do is have a solution that works in both environments, but I'm new to the use of API's and don't know how to be platform-specific in my [General] Declarations module of my application.
>
>Here's what works in NT4 (please forgive the VB5 syntax):
>
>Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
>
>Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpString As String, ByVal nSize%, ByVal lpFileName As String) As Long
>
>And...
> Valid% = GetPrivateProfileString(lpAppName$, lpKeyName$, lpDefault$, lpReturnString$, Size%, lpFileName$)
>
>Help would be appreciated.


Michael,

In your declaration for GetPrivateProfileString, you're indicating that the return buffer is passed by value. It should be passed by reference.

George
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform