Code::Blocks Forums
Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: nahn1989 on January 10, 2012, 10:26:16 am
-
Hi,
I want to develop a plugin for code::blocks. I compiled code::blocks nightly build rev 7671 on windows 7. If i use ListCtrlLogger in my plugin, on double click event, code::blocks crashes.
Please tell me how to compile the code blocks properly on windows 7.
-
See here:
http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows
Some more information is here:
http://wiki.codeblocks.org/index.php?title=Developer_documentation
Generally without code or more information it's hard to answer (if not impossible) why it is crashing.
-
Source code used is shown below.
namespace
{
const int ID_List = wxNewId();
};
BEGIN_EVENT_TABLE(Open_Tag_Log, wxEvtHandler)
//
END_EVENT_TABLE()
Open_Tag_Log ::Open_Tag_Log(const wxArrayString& Titles, wxArrayInt& Widths)
: ListCtrlLogger(Titles, Widths)
{
}
Open_Tag_Log::~Open_Tag_Log()
{
if (control && !Manager::IsAppShuttingDown())
{
control->RemoveEventHandler(this);
}
}
wxWindow* Open_Tag_Log::CreateControl(wxWindow* parent)
{
ListCtrlLogger::CreateControl(parent);
control->SetId(ID_List);
OpenTagLog.AppendToLog(_("Create Control Called"));
Connect(ID_List, -1, wxEVT_COMMAND_LIST_ITEM_ACTIVATED,
(wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction)
&Open_Tag_Log::OnDoubleClick);
control->PushEventHandler(this);
return control;
}
void Open_Tag_Log::OnDoubleClick(wxCommandEvent &event)
{
// go to the relevant file/line
OpenTagLog.AppendToLog(_("Double Click"));
if (control->GetSelectedItemCount() == 0)
{
return;
}
// find selected item index
const int Index = control->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
SyncEditor(Index);
}
-
Or post all the plugin source here(as a zip file), so some one can have a look.
Mostly, I suggest you debug your plugin under gdb.
-
How to debug the plugin using GDB on windows platform?
-
How to debug the plugin using GDB on windows platform?
As Morten said, you need to build the Codeblocks from source under Windows.
Debug your plugin is the same as debug c::b.
You build your plugin, and start debug c::b, then the c::b(debugee) will automatically load your plugin.
This is some kind of how to debug a dll. :)