User forums > Using Code::Blocks

C::B crash (Settings-->Editor)

<< < (12/16) > >>

Pecan:

--- Quote from: Michael on April 20, 2006, 09:21:11 pm ---Hello,

I think Pecan has solved the crash :D. I still have to test more in depth, but I got no more Settings-->Editors crash with codestats plugin :D. Moreover, codestats plugin works too without a crash :D.

To "solve" the problem, just:


--- Quote ---// some help functions and type (copied and adapted from the codestat plug-in)
struct LanguageDef
{
   wxString name; <-- Add this!
        wxArrayString ext;
   wxString single_line_comment;
   wxString multiple_line_comment[2];
};

--- End quote ---

Pecan, you save my day :). If you decide to visit Austria and/or Switzerland (Eventually Thailand too :)), let me know and I will pay at least a dinner :D.

Best wishes,
Michael


--- End quote ---

I don't think you want to do that!! That structure is being
treated as the default "constructor" for LanguageDef.
Change the name of LanguageDef to something like csLanguageDef
and define a constructor and destructor like:

--- Code: ---#include "language_def.h"
csLanguageDef::csLanguageDef()
{
    name = wxEmptyString;
    ext.clear();
    single_line_comment = wxEmptyString;
    multiple_line_comment[0] = wxEmptyString;
    multiple_line_comment[1] = wxEmptyString;
}
csLanguageDef::~csLanguageDef()
{;}

--- End code ---

This is going to happen again if you dont get away from that
structure....

thanks
pecan


Michael:

--- Quote from: Pecan on April 20, 2006, 09:33:35 pm ---I don't think you want to do that!! That structure is being
treated as the default "constructor" for LanguageDef.
Change the name of LanguageDef to something like csLanguageDef
and define a constructor and destructor like:

--- Code: ---#include "language_def.h"
csLanguageDef::csLanguageDef()
{
    name = wxEmptyString;
    ext.clear();
    single_line_comment = wxEmptyString;
    multiple_line_comment[0] = wxEmptyString;
    multiple_line_comment[1] = wxEmptyString;
}
csLanguageDef::~csLanguageDef()
{;}

--- End code ---

This is going to happen again if you dont get away from that
structure....

--- End quote ---

Ok. So, I have taken out the the wxString name from the structure and changed the name of the class LanguageDef (in Code Statistics project-->language_def.h) in CsLanguageDef and its instances in cslanguages/cslanguage (in Code Statistics project).

This seems to work too. I got no crashes until now :D.

Anyway, it seems that the codestats plugin now return that the project is empty, even if it is not :?.

Best wishes,
Michael

Pecan:

--- Quote from: Michael on April 20, 2006, 11:42:51 pm ---Anyway, it seems that the codestats plugin now return that the project is empty, even if it is not :?.

--- End quote ---

Ok, it makes sense that some quirks would occur now that
the code is changed. But it's much safer this way.

If you'd like me to test/trace through some of these problems,
you could zip up your code and attach it. I'll help if you'd like...

Also, How do you execute the plugin? Does it have a menu item?
I've never used it since the configuration structure changed some
months ago,
EDIT: found the menu item...

thanks
pecan

Michael:

--- Quote from: Pecan on April 20, 2006, 11:51:58 pm ---
--- Quote from: Michael on April 20, 2006, 11:42:51 pm ---Anyway, it seems that the codestats plugin now return that the project is empty, even if it is not :?.

--- End quote ---

Ok, it makes sense that some quirks would occur now that
the code is changed. But it's much safer this way.

If you'd like me to test/trace through some of these problems,
you could zip up your code and attach it. I'll help if you'd like...

--- End quote ---

I have just changed the class name and the name of all its instances within the Code Statistics project. Theoretically it should works, but may be there is a dependency with the structure in the sdk. Would have to check.

I have compressed the codestats plugin and put in my File Hosting system. You can get it from here.

Thank you very much for your help :).


--- Quote from: Pecan on April 20, 2006, 11:51:58 pm ---Also, How do you execute the plugin? Does it have a menu item?
I've never used it since the configuration structure changed some
months ago,

--- End quote ---

To execute the plugin, just open a project and then Plugins-->Code Statistics (be sure to have it selected under Plugins-->Manage plugins).

Best wishes,
Michael

killerbot:
I have borrowed some code and functions from the codestats, to provide some statistics in the properties panel of a projectfile.
Though the functions are at global scope; so different name then the plug-in, but it seems (have to check code, will do that in 2 hours) the structure has the same name. Maybe the linker/???/??? get's confused>. Though both definitions are in different dll's; so only when both dll's are loaded we (could) have twice the definition.

If there's a name clash, I don't think the plug-in should change, the "borrower" should change, that's only fair. Although I might have an idea on how to plug-in can protect itself against those "code stealers" ;-)

More on this later, should reread tha last topics and look at the code fore some better analysis.

Will be back soon ...

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version