diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2010-10-15 07:30:39 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2010-10-15 07:30:39 +0300 |
commit | 076c9cfcf33e06218805ad0412a806005c3c63f7 (patch) | |
tree | a2038b043736beee85e012bce34f960d70ad6d74 /plugins/example/main.cpp | |
parent | bd197c2ad7e360fb8008c50f8d423072926428dd (diff) |
lord_evil, i was made plugin example for you, coz i know, you are to lazy to read docs ;)
Diffstat (limited to 'plugins/example/main.cpp')
-rw-r--r-- | plugins/example/main.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/plugins/example/main.cpp b/plugins/example/main.cpp index edeb9e3..8c51548 100644 --- a/plugins/example/main.cpp +++ b/plugins/example/main.cpp @@ -1,5 +1,6 @@ #include <wx/wx.h> +#include <wx/stdpaths.h> #include <pluginapi.h> //this is necessary, PLUGININFO structure, other related to load/unload plugin code @@ -15,16 +16,18 @@ PLUGINLINK *pluginLink; bool wxPluginForEvilCore::OnInit() { + wxMessageBox(_T("I am a plugin example") ,_T("Info"), wxOK | wxICON_INFORMATION); return true; } - -/*HINSTANCE hInst; +#ifdef _WIN32 +HINSTANCE hInst; BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved ) //default dll entry point { hInst = hinstDLL; return TRUE; -}*/ //windows specific, does not needed ? +} //windows specific, does not needed ? +#endif PLUGININFO pluginInfo = { @@ -51,7 +54,17 @@ extern "C" int load(PLUGINLINK *link) //basic initialisation, registering new f extern "C" int on_modules_loaded() //load main code from here, all services from other plugins must be avaible here { wxApp::SetInstance(new wxPluginForEvilCore()); //create instance, i think here is right place, not in load where we do only basic initialisation -// wxEntry(GetModuleHandle(NULL),NULL,NULL,SW_SHOW); //here we need to get module handle somehow, commented string is for windows only +#ifdef _WIN32 + wxEntry(GetModuleHandle(NULL),NULL,NULL,SW_SHOW); +#else + int i = 0; + char **params = (char**)malloc(2); + params[0] = (char*)malloc(2); + strcpy(params[0], ""); + wxEntry(i, params); + free(params[0]); + free(params); +#endif return 0; } |