Code: Select all
UseSQLiteDatabase()
Macro Void : EndMacro
Prototype spatialite_alloc_connection()
If OpenLibrary(0, "mod_spatialite.dll")
If IsLibrary(0)
ExamineLibraryFunctions(0)
For i = 1 To CountLibraryFunctions(0)
Debug i
NextLibraryFunction()
Debug LibraryFunctionName()
Next
EndIf
If CreateFile(0, "test.sqlite")
;Debug "Database file created"
CloseFile(0)
EndIf
resultdb = OpenDatabase(0,"test.sqlite","","")
If resultdb
CallCFunction(0, "spatialite_initialize")
;Debug PeekS(*MessageBox,100,#PB_Ascii)
CallCFunction(0, "spatialite_set_verbode_mode",1)
;Debug PeekS(*MessageBox2,100,#PB_Ascii)
*result = CallCFunction(0, "spatialite_version")
Debug PeekS(*result,100,#PB_Ascii)
void *cache = AllocateMemory(5000,#PB_Memory_NoClear)
;*cache = AllocateMemory(5000,#PB_Memory_NoClear)
;*cache = CallCFunction(0, "spatialite_alloc_connection")
CallCFunction(0, "spatialite_init_ex",DatabaseID(0), *cache, 0);
;cache = spatialite_alloc_connection ();
;spatialite_init_ex (handle, cache, 0);
;*result2 = CallCFunction(0, "update_layer_statistics",resultdb)
;PokeI(*result2,9)
;Debug PeekI(*result2)
;*cache = CallCFunction(0, "spatialite_alloc_connection")
;spatialite_init_ex (handle, cache, 0);
;*MessageBox2 = CallCFunction(0, "spatialite_init_ex",DatabaseID(0) , *cache, 0)
;Debug PeekS(*MessageBox2,100,#PB_Ascii)
;Result = CallCFunction(0, "spatialite_init_ex" [,Parameter1 [, Parameter2...]])
;*db = CallCFunction(0, "spatialite_init_ex",DatabaseID(0) , *db, #True)
;Debug PeekS(*db,100,#PB_Ascii)
;test.i = IsLibrary(0)
;result.i = GetFunctionEntry(0, 3)
;result$ = LibraryFunctionName()
EndIf
;Debug result
Debug test$
;Debug result$
CloseLibrary(0)
Else
Debug "ERROR"
EndIf