News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

PluginRegistrant

Started by jsibarani, July 25, 2007, 02:55:32 PM

Previous topic - Next topic

jsibarani

Hi.

In PluginRegistrant's constructor, there is RegisterPlugin()


        PluginRegistrant(const wxString& name)
        {
            Manager::Get()->GetPluginManager()->RegisterPlugin(name, // plugin's name
                                                                &CreatePlugin, // creation
                                                                &FreePlugin, // destruction
                                                                &SDKVersion); // SDK version
        }


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

   namespace
   {
       PluginRegistrant<MyPlugin> registration("MyPlugin");
   }

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.
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

jsibarani