Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
When is Configure() called??
Pecan:
Why doesn't the following code in a plugin crash??
I'm running C::B 1.0RC1.1 and compiling with a wx242 DLL
WinXPsp2.
I never got a message box, so I inserted the INT3.
I don't get a message OR a crash.
I'm feeling ignored by my plugin. :lol:
int Untitled1::Configure()
{
// if not attached, exit
// if (!m_IsAttached)
// return -1;
asm("int3");
wxString msg = _("Configure called!");
wxMessageBox(msg, _("Error"), wxICON_ERROR | wxOK);
return 0;
}
Thanks
thomas:
--- Code: ---Untitled1::Untitled1
{
...
m_PluginInfo.hasConfigure = true;
...
}
--- End code ---
Then go to Settings --> Plugins' Settings --> Untitled1
Pecan:
Thankyou, I can crash now. :)
thomas:
Lol, I try to avoid that ;)
Pecan:
wups! I failed to notice that I already had m_PluginInfo.hasConfigure = true; in the ctor. I still can't crash.
Just goes to show, when ya wanna, ya can't.
Have I done something wrong in generating my wx 2.4.2 DLL??
Do I have an alien C::B??
I get the "Hello Code::Blocks" but no crash and no Configure() message.
I also noticed that when I compile other plugins, their Configure() doesnt
get executed either.
Could you point my nose the the right direction?
bPlugin* GetPlugin()
{
return new Untitled1;
}
Untitled1::Untitled1()
{
//ctor
m_PluginInfo.name = "UPlgN1";
m_PluginInfo.title = "uPlgN1";
m_PluginInfo.version = "1";
m_PluginInfo.description = "Mispent Intent";
m_PluginInfo.author = "Pecan";
m_PluginInfo.authorEmail = "";
m_PluginInfo.authorWebsite = "";
m_PluginInfo.thanksTo = "Code::Blocks Team";
m_PluginInfo.license = LICENSE_GPL;
//-m_PluginInfo.hasConfigure = false;
m_PluginInfo.hasConfigure = true;
}
Untitled1::~Untitled1()
{
//dtor
}
int Untitled1::Configure()
{
// if not attached, exit
// if (!m_IsAttached)
// return -1;
asm("int3");
wxString msg = _("Configure called!");
wxMessageBox(msg, _("Error"), wxICON_ERROR | wxOK);
return 0;
}
void Untitled1::OnAttach()
{
// do whatever initialization you need for your plugin
// NOTE: after this function, the inherited member variable
// m_IsAttached will be TRUE...
// You should check for it in other functions, because if it
// is FALSE, it means that the application did *not* "load"
// (see: does not need) this plugin...
}
void Untitled1::OnRelease(bool appShutDown)
{
// do de-initialization for your plugin
// if appShutDown is false, the plugin is unloaded because Code::Blocks is being shut down,
// which means you must not use any of the SDK Managers
// NOTE: after this function, the inherited member variable
// m_IsAttached will be FALSE...
}
int Untitled1::Execute()
{
//do your magic ;)
//NotImplemented("Untitled1::Execute()");
//return -1;
if( !IsAttached() )
return -1;
Manager::Get()->GetMessageManager()->Log( _("Hello World!") );
wxString msg = _("Hello Code::Blocks!");
wxMessageBox(msg, _("Error"), wxICON_ERROR | wxOK);
return 0;
}
Thanks
Navigation
[0] Message Index
[#] Next page
Go to full version