diff options
Diffstat (limited to 'modules/dbsqlite/main.cpp')
-rw-r--r-- | modules/dbsqlite/main.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/modules/dbsqlite/main.cpp b/modules/dbsqlite/main.cpp index c6462df..e1128f7 100644 --- a/modules/dbsqlite/main.cpp +++ b/modules/dbsqlite/main.cpp @@ -3,6 +3,7 @@ #include <pluginapi.h> #include <plugin_helper.h> +#include <db.h> #include "sqlite3.h" @@ -36,21 +37,29 @@ extern "C" __declspec(dllexport) PLUGININFO* SetPluginInfo() extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) { pluginLink = link; - sqlite3_open(".\\database.sql3", &db); - MessageBoxA(0, "dbsqlite plugin loaded", "INFO", MB_OK); + if(!sqlite3_open_v2(".\\database.sql3", &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL)) + MessageBoxA(0, "dbsqlite plugin loaded", "INFO", MB_OK); return 0; } extern "C" int __declspec(dllexport) OnModulesLoaded() { -// sqlite3_exec(db, "", 0, 0, &db_err); for(;;) Sleep(1000); return 0; } extern "C" int __declspec(dllexport) Unload() { - sqlite3_close(db); + while(sqlite3_close(db) == SQLITE_BUSY) + Sleep(1000); + MessageBoxA(0, "Database succesfuly unloaded", "INFO", MB_OK); return 0; } +SERVICE dbWriteSestting(WPARAM w, LPARAM l) +{ +} +SERVICE dbGetSetting(WPARAM w, LPARAM l) +{ +} + |