The following code is intended to retrieve the current printer. It works in OpenOffice but doesn't work in LibreOffice : calling GetProfileString in Main() returns no value in strbuffer (passed by reference). Declare Function GetProfileString Lib "kernel32" Alias "GetProfileStringA" (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByRef lpReturnedString As String, ByVal nSize As Long) As Long Sub Main Dim strBuffer as String Dim iRetValue as Long strbuffer = string (254) iRetValue = GetProfileString("windows", "device", ",,,", strBuffer, 254) msgbox (cstr(iretvalue) + " " + strbuffer) End Sub
I'll take a look at this
this is also an error in oracle office builds ( see.http://qa.openoffice.org/issues/show_bug.cgi?id=115716 ), we should have the fix for 3.3.2 at least
(In reply to comment #0) I had the same problem with various functions similar to this one: Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long With OpenOffice 3.3.0, I must remove the "ByVal" before lpBuffer. With LibreOffice 3.3.2, I must put the "ByVal" before lpBuffer. I don't know who is right, but this incompatibility is annoying... Seen on Windows (XP and Vista)
seen fixed in recent builds ( 4.0 at least )