Author Topic: Plugin crashing in debug when linked against wxmsw28 on MSW  (Read 5171 times)

Offline Gagh

  • Multiple posting newcomer
  • *
  • Posts: 12
At the moment I'm playing around with a first version of the proposed SCM plugin, just to get a feel how to write a C::B plugin.

I used the wizard to create a generic plugin, checked all the boxes and: WOW! Got a plugin.

After looking at some of the other plugins I managed to add a SCM menu in the main menu bar, the context menu's for the different locations and a settings panel which saves and reads settings using the ConfigManager . The toolbar I need to look at, don't know if it is needed, but as I understand it now, is that it should give a panel in the Messages window, like the build log and build messages. Guess we will need it to produce the output from the SCM system invocation.

But to get to the point, invoking Settings->Environment produces an unhandled exception caused by a read.

I'm building with svn 3791, mingw with gcc 3.4.2 and wxWidgets 2.8.4. All build on my xp box, as unicode.

When I link the debug version of my plugin against wxmsw28u_gcc_custom.dll, all is well. But when I link against wxmsw28ud_gcc_custom.dll, as should be done, as it is a debug version, I get a nice crash when I try to open Settings->Environment.
Seems that something is checked in the debug version of wxWidgets and that it isn't right. My guess is an assert on a null pointer. Don't know if this is a know issue or that I'm making some mistake in my settings.

I have a problem with loading the bitmap for the panel in the Environment view, so I think that in the debug version wxWidgets checks for a valid bitmap, but as the creation of the bitmap failed, it is a null pointer and it asserts on it.

Any help is welcome, it might be fixed when the bitmap is correctly loaded.

I have the following in the header of the cbConfigurationPanel class for the basename, the class is managed by wxSmith without xrc:

Code
    virtual wxString GetBitmapBaseName() const
    {
        return _T("codeblocks-scm");
    }

The bitmaps are included in the .cbplugin zip to install it, with the same name as stated above. The following is put into SCM.cbplugin:

Code
Running project post-build steps
zip -j9 SCM.zip manifest.xml
updating: manifest.xml
 (188 bytes security) (deflated 52%)
zip -j9 SCM.zip codeblocks-scm.png codeblocks-scm-off.png
updating: codeblocks-scm.png (188 bytes security) (stored 0%)
updating: codeblocks-scm-off.png (188 bytes security) (deflated 4%)
zip -j9 SCM.cbplugin SCM.dll SCM.zip
updating: SCM.dll
 (188 bytes security) (deflated 81%)
updating: SCM.zip (188 bytes security) (deflated 2%)

So far I'm pleased with the progress and must say I like the way how things work, including creating the panel with wxSmith. It's a bit different than most other resource editors, but once you get it, it is a very nice way to make them.

If needed I can send the source, but it is MSW only atm.

Thx in advance for a solution.
OS: winXP sp3 | FreeBSD 7.0-stable | Ubuntu
Compiler: mingw 5.1.3 | gcc 4.2.1 | gcc 4.2.1
IDE: Code::Blocks SVN (on all) WX: 2.8.7 | 2.8.0 | 2.8.8

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Plugin crashing in debug when linked against wxmsw28 on MSW
« Reply #1 on: May 24, 2007, 08:58:26 am »
Quote
The bitmaps are included in the .cbplugin zip to install it, with the same name as stated above.

This is currently not implemented (installing icons inside .cbplugin). You will have to copy them manually atm...
Be patient!
This bug will be fixed soon...

Offline Gagh

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Plugin crashing in debug when linked against wxmsw28 on MSW
« Reply #2 on: May 24, 2007, 09:52:56 pm »
Quote
The bitmaps are included in the .cbplugin zip to install it, with the same name as stated above.

This is currently not implemented (installing icons inside .cbplugin). You will have to copy them manually atm...

Managed to copy them to the correct directory, all is well now.

I rebuild C::B from svn (at rev 3791) and the crashes are gone for now. Don't know what went wrong exactly, but can't reproduce it anymore.
OS: winXP sp3 | FreeBSD 7.0-stable | Ubuntu
Compiler: mingw 5.1.3 | gcc 4.2.1 | gcc 4.2.1
IDE: Code::Blocks SVN (on all) WX: 2.8.7 | 2.8.0 | 2.8.8