Jump to content

Recommended Posts

Posted
; SQLite3 dll version must match

#include <MsgBoxConstants.au3>
#include <SQLite.au3>
#include <SQLite.dll.au3>

Global $sSQliteDll = _SQLite_Startup()
If @error Then
    If MsgBox($MB_SYSTEMMODAL + $MB_YESNO + $MB_DEFBUTTON2, "SQLite Error", (@AutoItX64 ? 'SQLite3_x64.dll' : 'SQLite3.dll') & " Can't be Loaded!" & @CRLF & @CRLF & _
            "Not FOUND in @ScriptDir, @WorkingDir," & @CRLF & @TAB & "@LocalAppDataDir\AutoIt v3\SQLite," & @CRLF & @TAB & "@SystemDir or @WindowsDir" & _
            @CRLF & @CRLF & "Would you like to go to the site to download it ?") = $IDYES Then ShellExecute("https://www.sqlite.org/download.html")
    Exit 4
EndIf

MsgBox($MB_SYSTEMMODAL, (@AutoItX64 ? 'SQLite3_x64.dll' : 'SQLite3.dll') & " Loaded", $sSQliteDll & " (v" & _SQLite_LibVersion() & ")")
ConsoleWrite("_SQLite_LibVersion=" & _SQLite_LibVersion() & @CRLF)
_SQLite_Shutdown()

This "Example 1" will be better than the current one.
If the DLL is not there it takes you to the site for download.
 

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Posted

..to be or not to be..

As the well read and organized coder that I am ( or aim to be :D ) I read the WiKi. Add button(s) with $idRun, and $idCancel to have $idCntrlName = ...
Then I run the script and I get "error: $idCancel previously declared as a 'Const'." and I open the offending file and I read:

...
Global Const $MB_SERVICE_NOTIFICATION = 0x00200000 ; The caller is a service notifying the user of an event.

Global Const $MB_RIGHTJUSTIFIED = $MB_RIGHT ; Do not use, see $MB_RIGHT. Included for backwards compatibility.

; Indicates the button selected in the message box
Global Const $IDTIMEOUT = -1 ; The message box timed out
Global Const $IDOK = 1 ; OK button was selected
Global Const $IDCANCEL = 2 ; Cancel button was selected
...

... I found it, "funny" ? 🤷‍♂️

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...