Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Help Required.

(1/2) > >>

nahn1989:
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.

MortenMacFly:
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.

nahn1989:
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);
}

ollydbg:
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.

nahn1989:
How to debug the plugin using GDB on windows platform?

Navigation

[0] Message Index

[#] Next page

Go to full version