Home » U++ Library support » U++ Library : Other (not classified elsewhere) » "All shared" in Windows question
Re: "All shared" in Windows question [message #18839 is a reply to message #18838] |
Sun, 26 October 2008 09:55 |
Mindtraveller
Messages: 917 Registered: August 2007 Location: Russia, Moscow rgn.
|
Experienced Contributor |
|
|
///////MAIN EXE
typedef void (* PlugFunc)();
struct Plugin
{
PlugFunc plugStart, plugFinish;
bool activated;
DLLHANDLE handle;
Plugin() :plugStart(0), plugFinish(0), activated(false) {}
void Start() {plugStart();}
};
Array<Plugin> plugins;
AdvPlugTest::AdvPlugTest()
{
::CtrlLayout(*this);
plugStart <<= THISBACK(PluginStart);
plugList.AddColumn("Найдены плагины");
FindFile ff(DIR_PLUGINS+"*.dll");
while (ff)
{
plugList.Add(ff.GetName());
ff.Next();
Plugin newPlugin;
String pluginName = DIR_PLUGINS+ff.GetName();
static const char *const names[3] = {"PlugStart", "PlugFinish",0};
void * procs[] = {&newPlugin.plugStart,&newPlugin.plugFinish,0};
newPlugin.handle = LoadDll__(pluginName, &names[0], &procs[0]);
plugins.Add(newPlugin);
}
}
void AdvPlugTest::PluginStart()
{
int row = plugList.GetClickRow();
if (row<0 || row>=plugList.GetCount())
row = 0;
if (plugins[row].activated)
return;
plugins[row].activated = true;
plugins[row].Start();
}
///////DLL
Plug *plug = 0;
extern "C"
{
DLLEXPORT void PlugStart();
DLLEXPORT void PlugFinish();
};
extern "C" void PlugStart()
{
plug = new Plug();
plug->Execute();
}
extern "C" void PlugFinish()
{
delete plug;
}
Plug::Plug()
{
::CtrlLayout(*this, "Plugin window");
}
[Updated on: Sun, 26 October 2008 09:57] Report message to a moderator
|
|
|
|
|
"All shared" in Windows question
|
|
|
Re: "All shared" in Windows question
|
|
|
Re: "All shared" in Windows question
By: captainc on Wed, 15 October 2008 17:39
|
|
|
Re: "All shared" in Windows question
By: Oblivion on Wed, 15 October 2008 23:05
|
|
|
Re: "All shared" in Windows question
|
|
|
Re: "All shared" in Windows question
By: captainc on Thu, 16 October 2008 13:53
|
|
|
Re: "All shared" in Windows question
|
|
|
Re: "All shared" in Windows question
By: mirek on Fri, 17 October 2008 15:45
|
|
|
Re: "All shared" in Windows question
|
|
|
Re: "All shared" in Windows question
By: mr_ped on Fri, 17 October 2008 23:54
|
|
|
Re: "All shared" in Windows question
By: mirek on Sat, 18 October 2008 08:58
|
|
|
Re: "All shared" in Windows question
|
|
|
Re: "All shared" in Windows question
By: mirek on Sun, 26 October 2008 07:57
|
|
|
Re: "All shared" in Windows question
|
|
|
Re: "All shared" in Windows question
By: mirek on Fri, 31 October 2008 14:31
|
|
|
Re: "All shared" in Windows question
By: cocob on Mon, 17 November 2008 12:17
|
|
|
Re: "All shared" in Windows question
By: mirek on Mon, 17 November 2008 19:42
|
|
|
Re: "All shared" in Windows question
By: cocob on Mon, 17 November 2008 12:27
|
|
|
Re: "All shared" in Windows question
By: Factor on Thu, 20 November 2008 11:11
|
Goto Forum:
Current Time: Fri Jun 07 02:38:48 CEST 2024
Total time taken to generate the page: 0.01547 seconds
|