I added a Kernel32.desc file in my userlibs sub-directory. It has the following in it:
.lib "Kernel32.dll"
GetVersionEx%(lpOSVersionInfo*):"GetVersionExA"
GetPrivateProfileString%(sectionName$,keyName$,default$,retStr$,bufSize%,fileName$):"GetPrivateProfileStringA"
WritePrivateProfileString%(sectionName$,keyName$,strValue$,fileName$):"WritePrivateProfileStringA"
The WritePrivateProfileString call works great. However, the GetPrivateProfileString call seems to be failing. I am calling it like this in B+:
Const kTileWidth = 64
Local tileWidth$
GetPrivateProfileString( "GameDefs", "TileWidth", Str( kTileWidth ), tileWidth$, 16, "Game.ini" )
This always returns ""
Why doesn't this work? I am guessing the 5th parameter size is screwing things up. It should be a DWORD and I am passing an integer. Not sure if they are the same size for B+.
.lib "Kernel32.dll"
GetVersionEx%(lpOSVersionInfo*):"GetVersionExA"
GetPrivateProfileString%(sectionName$,keyName$,default$,retStr$,bufSize%,fileName$):"GetPrivateProfileStringA"
WritePrivateProfileString%(sectionName$,keyName$,strValue$,fileName$):"WritePrivateProfileStringA"
The WritePrivateProfileString call works great. However, the GetPrivateProfileString call seems to be failing. I am calling it like this in B+:
Const kTileWidth = 64
Local tileWidth$
GetPrivateProfileString( "GameDefs", "TileWidth", Str( kTileWidth ), tileWidth$, 16, "Game.ini" )
This always returns ""
Why doesn't this work? I am guessing the 5th parameter size is screwing things up. It should be a DWORD and I am passing an integer. Not sure if they are the same size for B+.