diff options
Diffstat (limited to 'plugins')
-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; } |