Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
PluginRegistrant
(1/1)
jsibarani:
Hi.
In PluginRegistrant's constructor, there is RegisterPlugin()
--- Code: --- PluginRegistrant(const wxString& name)
{
Manager::Get()->GetPluginManager()->RegisterPlugin(name, // plugin's name
&CreatePlugin, // creation
&FreePlugin, // destruction
&SDKVersion); // SDK version
}
--- End code ---
I noticed that LoadPlugin() will triggered the call to RegisterPlugin(),but
which part of Code::Blocks is calling RegisterPlugin() ?
It's very confusing for me, because
--- Code: --- namespace
{
PluginRegistrant<MyPlugin> registration("MyPlugin");
}
--- End code ---
is inside a plugins' dll.
i'm sorry for my ignorant and my bad english.
:)
TDragon:
RegisterPlugin() is called from the PluginRegistrant constructor (as you noticed), when the plugin DLL is loaded and the templated global PluginRegistrant object for that plugin is created.
jsibarani:
Thanks ,T.
Navigation
[0] Message Index
Go to full version