From a8527496d9c8eb81710e718be7be8a9ae62a48b4 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Thu, 5 Aug 2010 00:46:19 +0300 Subject: new file: api/core_services.h modified: api/pluginapi.h modified: core/main.cpp modified: core/plugin.h new file: core/sqlite3.dll new file: lib/libsqlite3.a new file: modules/dbsqlite/Makefile new file: modules/dbsqlite/main.cpp new file: modules/dbsqlite/sqlite3.h modified: modules/example/main.cpp --- modules/example/main.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'modules/example/main.cpp') diff --git a/modules/example/main.cpp b/modules/example/main.cpp index 647654e..438e281 100644 --- a/modules/example/main.cpp +++ b/modules/example/main.cpp @@ -3,6 +3,8 @@ #include //this is necessary, PLUGININFO structure, other related to load/unload plugin code #include //just helper, not necessary +#include + PLUGINLINK *pluginLink; @@ -21,7 +23,7 @@ PLUGININFO pluginInfo = 0, //author 0, //author email PLUGIN_MAKE_VERSION(0,0,0,1), //version - GLOBAL_ACCESS_FLAG //flags + F_GLOBAL_ACCESS //flags }; extern "C" __declspec(dllexport) PLUGININFO* SetPluginInfo() @@ -33,12 +35,21 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) //basic initialisat { pluginLink = link; //necessary MessageBoxA(0, "Simple plugin initialisation done", "INFO", MB_OK); + TestService(); //only core servisec avaible in load return 0; //all ok, retrun 0 } extern "C" int __declspec(dllexport) OnModulesLoaded() //load main code from here, all services from other plugins must be avaible here { MessageBoxA(0, "Advanced plugin features needed services from other plugins are working from now", "INFO", MB_OK); - CallService("Test", 0, 0); //usage example of service registered in core + CallService("Core/Test", 0, 0); //usage example of service registered in core + TestService(); //same as above, look in core_services.h + Shutdown(); //same as CallService("Core/Shutdown", 0, 0); ,this will shutdown program return 0; } +extern "C" int __declspec(dllexport) Unload() +{ + //close open files, databases, save settings in memory to db, e.t.c. here. + return 0; +} + -- cgit v1.2.3