summaryrefslogtreecommitdiff
path: root/modules/example/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/example/main.cpp')
-rw-r--r--modules/example/main.cpp15
1 files changed, 13 insertions, 2 deletions
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 <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>
+
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;
+}
+