From 63edbec1418f493ff86a3e0615a50b0fb83ab6a5 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Thu, 5 Aug 2010 01:31:34 +0300 Subject: new file: ../../api/db.h modified: ../dbsqlite/main.cpp modified: main.cpp --- modules/example/main.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'modules/example/main.cpp') diff --git a/modules/example/main.cpp b/modules/example/main.cpp index 438e281..ecba903 100644 --- a/modules/example/main.cpp +++ b/modules/example/main.cpp @@ -28,12 +28,13 @@ PLUGININFO pluginInfo = extern "C" __declspec(dllexport) PLUGININFO* SetPluginInfo() { - return &pluginInfo; + return &pluginInfo; //necessary } extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) //basic initialisation, registering new functions, do other basic initialisation, you can create infinite loop, or other code which use many time here, only fast basic initialisation { pluginLink = link; //necessary + //some basic initialisation code MessageBoxA(0, "Simple plugin initialisation done", "INFO", MB_OK); TestService(); //only core servisec avaible in load return 0; //all ok, retrun 0 @@ -42,14 +43,17 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) //basic initialisat 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("Core/Test", 0, 0); //usage example of service registered in core - TestService(); //same as above, look in core_services.h + //some code +// TestService(); //same as CallService("Core/Test", 0, 0); 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. + //some code + MessageBoxA(0, "Plugin Sucesfully unloaded", "INFO", MB_OK); return 0; } -- cgit v1.2.3