Author Topic: PluginRegistrant  (Read 4637 times)

Offline jsibarani

  • Multiple posting newcomer
  • *
  • Posts: 31
PluginRegistrant
« on: July 25, 2007, 02:55:32 pm »
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
        }

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");
   }
is inside a plugins' dll.


i'm sorry for my ignorant and my bad english.
 :)

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: PluginRegistrant
« Reply #1 on: July 26, 2007, 12:53:46 am »
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.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline jsibarani

  • Multiple posting newcomer
  • *
  • Posts: 31
Re: PluginRegistrant
« Reply #2 on: July 27, 2007, 07:31:03 am »
Thanks ,T.