kylomas Posted September 23, 2016 Share Posted September 23, 2016 (edited) DLL call rookie having trouble figuring this out... #include <sqlite.au3> ; sqlite limit constants ; defined in https://www.sqlite.org/c3ref/c_limit_attached.html Local $SQLITE_LIMIT_LENGTH = 0 Local $SQLITE_LIMIT_SQL_LENGTH = 1 Local $SQLITE_LIMIT_COLUMN = 2 Local $SQLITE_LIMIT_EXPR_DEPTH = 3 Local $SQLITE_LIMIT_COMPOUND_SELECT = 4 Local $SQLITE_LIMIT_VDBE_OP = 5 Local $SQLITE_LIMIT_FUNCTION_ARG = 6 Local $SQLITE_LIMIT_ATTACHED = 7 Local $SQLITE_LIMIT_LIKE_PATTERN_LENGTH = 8 Local $SQLITE_LIMIT_VARIABLE_NUMBER = 9 Local $SQLITE_LIMIT_TRIGGER_DEPTH = 10 Local $SQLITE_LIMIT_WORKER_THREADS = 11 Local $dllName = _SQLite_Startup() If @error Then Exit MsgBox(17, 'Startup Error', '@ERROR = ' & @error & @CRLF & '@EXTENDED = ' & @extended) ConsoleWrite($dllName & @CRLF) If Not $__g_hDll_SQLite Then Exit MsgBox(17, '', '$SQLITE_MISUSE') Local $hdb = _SQLite_Open() If @error Then Exit MsgBox(17, 'DB open failed', '@ERROR = ' & @error & @CRLF & '@EXTENDED = ' & @extended) ; call defined in https://www.sqlite.org/c3ref/limit.html Local $r = DllCall($__g_hDll_SQLite, "int", "sqlite3_limit", "ptr", $hdb, "int", $SQLITE_LIMIT_SQL_LENGTH, "int", -1) If @error Then Exit ConsoleWrite(@error & @CRLF) ConsoleWrite($r[0] & @CRLF) _SQLite_Shutdown() Returns Quote >"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\Tom\Desktop\limits.au3" /UserParams +>15:41:30 Starting AutoIt3Wrapper v.15.920.938.0 SciTE v.3.6.0.0 Keyboard:00000409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64 Environment(Language:0409) +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\Tom\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\Tom\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.14.2) from:C:\Program Files (x86)\AutoIt3 input:C:\Users\Tom\Desktop\limits.au3 +>15:41:30 AU3Check ended.rc:0 >Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\Tom\Desktop\limits.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop sqlite3.dll !>15:41:32 AutoIt3.exe ended.rc:-1073741819 +>15:41:32 AutoIt3Wrapper Finished. >Exit code: 3221225477 Time: 2.286 Help, please, kylomas P.S. Tried return type as "int:cdecl", "long" and "long:cdecl" with same results Edited September 23, 2016 by kylomas additional info Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Danyfirex Posted September 23, 2016 Share Posted September 23, 2016 (edited) Hello. This works for me. Local $r = DllCall($__g_hDll_SQLite, "int:cdecl", "sqlite3_limit", "ptr", $hdb, "int", $SQLITE_LIMIT_SQL_LENGTH, "int", -1) Saludos Edited September 23, 2016 by Danyfirex Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
genius257 Posted September 23, 2016 Share Posted September 23, 2016 i do believe 34 minutes ago, kylomas said: -1073741819 is the code for an access violation. and if i do this: DllCall($__g_hDll_SQLite, "int:cdecl", "sqlite3_limit", "ptr", $hdb, "int", $SQLITE_LIMIT_SQL_LENGTH, "int", -1) it seems to solve the issue. My highlighted topics: AutoIt Package Manager, AutoItObject Pure AutoIt, AutoIt extension for Visual Studio Code Github: AutoIt HTTP Server, AutoIt HTML Parser Link to comment Share on other sites More sharing options...
kylomas Posted September 23, 2016 Author Share Posted September 23, 2016 Thank you both...it works. It did not work when I tried "int:cdecl" because I did not have a valid DB conn. kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now