>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.
Yes, there are differences although if you code it right it shouldn't make a difference. The main difference is that NT uses Wide
Character Sets for API calls and thus fills the rest of your string with garbage after the NULL when it returns to VFP. If you're not
checking for the NULL properly (or just kill the first NULL) you might get garbage.
It's hard to blow up GetPrivateProfileString because the API actually performs string bound and pointer checking internally.
What exactly are you seeing?
FWIW, the right way to call it and convert the string is like this:
lnResult=GetPrivateProfileString(lcSection,lcVariable,"*NONE*",;
@lcResult,LEN(lcResult),THIS.cContentFile)
lcResult = SUBSTR(lcResult,1,lnResult)