OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Call GetPrivateProfileSt doesn't work anymore with OOo 3.3.0

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
marco_lazzarini
Newbie
Newbie


Joined: 27 Jan 2011
Posts: 2

PostPosted: Wed May 25, 2011 1:33 am    Post subject: Call GetPrivateProfileSt doesn't work anymore with OOo 3.3.0 Reply with quote

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?
Back to top
View user's profile Send private message
B Marcelly
Super User
Super User


Joined: 12 May 2004
Posts: 1453
Location: France

PostPosted: Fri May 27, 2011 5:32 am    Post subject: Reply with quote

Hi,
After numerous test variants and crashes, it is obviously a regression bug. Evil or Very Mad

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 / Apache OpenOffice 4.0.1 / LibreOffice 4.1.0
MS-Windows 7 Home SP1
This forum is spammed, use instead Apache OpenOffice forums
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group