On 02/19/2014 04:08 PM, Bill Martin wrote:
I've tried to implement the simple example shown in the Calc Help system for
the Declare Statement.  Somewhere it expects to find a file: user32.dll but
I have no idea where to find it.  Windows has  many user32.dll files for
it's own use  but presumably none of them are relevant to LibreOffice.The
file does not seem to be included in the DLL files that install with Libre.
So does it need to be downloaded from the web somewhere and manually
installed?I'm just trying to understand how to link Basic to a DLL file so I
can go off and do something more complex.   Thanks.Bill

The point is that the user32.dll file is not relevant to LibreOffice, yet you should be able to call methods in it.

What is your operating system? Obviously it is Windows, so, which version of windows? 7, 8?

What error do you receive if you try to run the following macro?

Declare Sub MyMessageBeep Lib "user32.dll" Alias "MessageBeep" ( Long )
Declare Function CharUpper Lib "user32.dll" Alias "CharUpperA"_
   (ByVal lpsz As String) As String

Sub ExampleCallDLL
  REM Convert a string to uppercase
  Dim strIn As String
  Dim strOut As String
  strIn  = "i Have Upper and Lower"
  strOut = CharUpper(strIn)
  MsgBox "Converted:" & CHR$(10) & strIn & CHR$(10) &_
         "To:" & CHR$(10) & strOut, 0, "Call a DLL Function"
  REM On my computer, this plays a system sound
  Dim nBeepLen As Long
  nBeepLen = 5000
  MyMessageBeep(nBeepLen)
  FreeLibrary("user32.dll" )
End Sub



--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
Info:  http://www.pitonyak.org/oo.php


--
To unsubscribe e-mail to: [email protected]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Reply via email to