Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: secks on May 13, 2009, 05:33:04 pm

Title: Canceling the compiler on cbEVT_COMPILER_STARTED event
Post by: secks on May 13, 2009, 05:33:04 pm
I'm writing a plugin for the latest svn build (linux) that handles the cbEVT_COMPILER_STARTED event.  I want to be able to abort the compile (using the gcc compiler) on that event.  I have the plugin object and tried calling KillProccess on it but it does nothing.  The compiler plugin is also returning false when I call IsRunning .. Any ideas? .. Example:
Code
void MyPlugin::OnCompilerStarted(CodeBlocksEvent& event) {
if (IsAttached()) {
if(!m_allowCompile) {
cbCompilerPlugin *plugin = (cbCompilerPlugin*)(event.GetPlugin());
if(plugin->IsRunning()) {
wxMessageBox(_("running"));
} else {
wxMessageBox(_("not running"));
}
plugin->KillProcess();
}
}
}