diff options
Diffstat (limited to 'modules/example')
-rw-r--r-- | modules/example/main.cpp | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/modules/example/main.cpp b/modules/example/main.cpp index e778c9c..a4c0ee6 100644 --- a/modules/example/main.cpp +++ b/modules/example/main.cpp @@ -1,13 +1,34 @@ #include <windows.h> #include <api.h> #include <pluginapi.h> +#include <iostream> -HINSTANCE hDllInstance=NULL; -BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) //default dll entry point +HINSTANCE hInst; +BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved ) //default dll entry point { - if (ul_reason_for_call == DLL_PROCESS_ATTACH) - hDllInstance = (HINSTANCE)hModule; + hInst = hinstDLL; return TRUE; } - +PLUGININFO pluginInfo = +{ + sizeof(PLUGININFO), //size of structure + (char*)"example plugin", //short name + 0, //description + 0, //author + 0, //author email + PLUGIN_MAKE_VERSION(0,0,0,1), //version + 0 //flags (unused) +}; + +extern "C" __declspec(dllexport) PLUGININFO* SetPluginInfo() +{ + return &pluginInfo; +} + +extern "C" int __declspec(dllexport) Load() +{ + std::cout<<"core run every code in this function.\n"; + return 0; //all ok, retrun 0 +} + |