diff options
-rw-r--r-- | modules/dbsqlite/main.cpp | 2 | ||||
-rw-r--r-- | modules/example/main.cpp | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/modules/dbsqlite/main.cpp b/modules/dbsqlite/main.cpp index 7db4691..35ec873 100644 --- a/modules/dbsqlite/main.cpp +++ b/modules/dbsqlite/main.cpp @@ -121,7 +121,7 @@ SERVICE svc_dbGetSetting(WPARAM w, LPARAM l) SERVICE svc_dbDeleteSetting(WPARAM w, LPARAM l) { - PLUGININFO *info = (PLUGININFO*)w; + PLUGININFO *info = (PLUGININFO*)w; DATA *data = (DATA*)l; char buf[512]; strcpy(buf, "DELETE FROM data WHERE module = '"); diff --git a/modules/example/main.cpp b/modules/example/main.cpp index c416393..acc8eae 100644 --- a/modules/example/main.cpp +++ b/modules/example/main.cpp @@ -3,7 +3,7 @@ #include <pluginapi.h> //this is necessary, PLUGININFO structure, other related to load/unload plugin code #include <plugin_helper.h> //just helper, not necessary -#include <core_services.h> +#include <core_services.h> //services implemented in core #include <db.h> //database support @@ -51,7 +51,13 @@ extern "C" int __declspec(dllexport) OnModulesLoaded() //load main code from her dat.wType = D_INT; dat.pData = (void*)123; dat.szSetting = (char*)"some_name"; - dbSetSetting((WPARAM)&pluginInfo, (LPARAM)&dat); + dbSetSetting((WPARAM)&pluginInfo, (LPARAM)&dat); //write integer to db + dat.szSetting = (char*)"useless"; + dbDeleteSetting((WPARAM)&pluginInfo, (LPARAM)&dat); //delete "useless" from db + dat.wType = D_STRING; + dat.szSetting = (char*)"some_string"; + dat.szModule = (char*)"some module shortName"; + dbGetSetting(0, (LPARAM)&dat); //retrieve "some_string" from "some modules shortName", or retrieve "some_string" from self if dat.szModules = 0 and WPARAM is PLUGININFO link (currently unimplemented in db plugin) return 0; } extern "C" int __declspec(dllexport) Unload() |