Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
NT4 API GetPrivateProfileString vs Win95 Help!
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00038058
Message ID:
00038098
Views:
38
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform