From 599d73442416d9bad663e4d0900265e073946600 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Thu, 5 Aug 2010 04:40:30 +0300 Subject: modified: ../dbsqlite/main.cpp modified: main.cpp --- modules/dbsqlite/main.cpp | 2 +- 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 //this is necessary, PLUGININFO structure, other related to load/unload plugin code #include //just helper, not necessary -#include +#include //services implemented in core #include //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() -- cgit v1.2.3