Possibly an amateur mistake in assuming that this Dll would work with AutoHotKey, as I seem to be having some issues.
I've uploaded my current code to the SVN server in the first post, and can post a snapshot of it directly in the post if need be.
Here's the problem.
From the help file:
Quote:
slOpen ([rsFileName String, rsModChars String]) Long
FileName is the SQLite file to open as a database. There are two
special file names:
1. :memory: = opens an empty database in memory
2. empty or omitted = opens an empty temporary database on disk
FileName may also contain an optional password. This password
is separated from the file name by the $BS character.
ModChars:
C = Create if not there. Ignored if ReadOnly.
Em = Return errors. This will override the global return errors flag.
m is the optional message display modifier and can be:
0 = No message is displayed. This is the default.
1 = Display a warning message with OK button. Error is
returned when OK pressed.
2 = Display a question message with OK and Cancel buttons.
If they press OK, error is returned. If they press
Cancel, will exit process.
e = Do not return errors, display message and exit process. This
will override the global return errors flag.
R = ReadOnly.
Tn = Where n is milliseconds to wait for a database lock.
Defalut is 10000 milliseconds (10 seconds). If running
in remote mode then the TCP SEND/RECV wait as set in
slConnect should be at least 3 times as long as this
wait.
Returns zero if processed OK. Else, depending on ModChars and the global
return errors flag, will either display error and exit or will return
the error number.
My function:
Code:
SQLt_slOpen(rsFileName="", rsModChars="") {
If Dll := SQLt_Init() {
If rsFileName {
If rsModChars {
Result := DllCall(Dll . "\slOpen"
, "UInt", &rsFileName
, "UInt", &rsModChars
, "Cdecl Int")
} Else {
Result := DllCall(Dll . "\slOpen"
, "str", rsFileName
, "Cdecl Int")
}
} Else {
Result := DllCall(Dll . "\slOpen", "Cdecl Int")
}
ErrorLevel := SQLt_slGetErrorNumber()
Result := (Result = 0)
} Else Result := false
Return Result
}
Calling it like this:
SQLt_slOpen("Example.db3", "C")
Throws the error:
Quote:
---------------------------
SQLitening
---------------------------
SQLite or SQLitening returned the following unexpected message!
-9 = File does not exist
Statement = Open "Example.db3
---------------------------
OK
---------------------------
(Not a typo; there is no closing quote in the error message and nothing listed after db3)
Like it doesn't see the "C" parameter for rsModChars. If I create the Example.db3 file beforehand, the function seems to work (no error at least) with or without the "C" as the rsModChars parameter. But then no other functions seem to work either.
I've tried changing between "Str" and using "Uint" and calling the vars with an &Var syntax, both have the same issue. I even tried adding the Cdecl ReturnType at the end of the functions which listed a return type in the help file for SQLitening, as you can see in my code above.
The SQLitening.dll file is written in PowerBasic. I also tried using the functions in SQLiteningVB.dll file (the same functions bridged to Visual Basic functions) but they didn't work (maybe to be expected?)
I'm going to keep trying to figure it out, but I don't know at this point if I'm going to be able to use the DLL with AHK.