marco_lazzarini Newbie

Joined: 27 Jan 2011 Posts: 2
|
Posted: Wed May 25, 2011 1:33 am Post subject: Call GetPrivateProfileSt doesn't work anymore with OOo 3.3.0 |
|
|
Hi all,
My code to read .INI files through API 'GetPrivateProfileString' doesn't work anymore with OOo 3.3.0
| Code: |
Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" _
(ByVal lpApplicationName As String, _
ByVal lpKeyName As String, _
ByVal lpDefault As String, _
lpReturnedString As String, _
ByVal nSize As Long, _
ByVal lpFileName As String) As Long
Public Function GetIniString(sSection As String, sKey As String, sFileName As String) As String
Dim lReturn
Dim Str_return As String
Str_return = String(255,vbnullstring)
lReturn = GetPrivateProfileString(sSection, sKey, "", Str_return, 255, sFileName )
If lReturn > 0 Then
GetIniString = Left(Str_return, lReturn)
Else
GetIniString = ""
End If
End Function
|
The code has been working great till ver 3.2.1, but now it fails returning 0.
is to be said that some params passed ByVal ('sSection', 'sKey', 'sFileName' ) are modified (!!!some char added!!!) after call to 'lReturn = GetPrivateProfileString...'.
The only param i expected to see modified is the one passed ByRef 'Str_return' which should contain the result.
Can anyone help? |
|
B Marcelly Super User

Joined: 12 May 2004 Posts: 1414 Location: France
|
Posted: Fri May 27, 2011 5:32 am Post subject: |
|
|
Hi,
After numerous test variants and crashes, it is obviously a regression bug.
I found bug reports 115795 and 115716 that seem dealing with the same problem. Bug report 115795 specifically says that something has changed in OOo 3.3.
Should be corrected in 3.4. _________________ Bernard
OpenOffice.org 1.1.5 fr / OpenOffice.org 3.4.1 en-US + langpacks, MS-Windows XP Home SP3
This forum is unusable, use instead Apache OpenOffice forums |
|