Re: Unable to delete any GTK::Widget



On 2/18/08, Erwin_X <erwinvast gmail com> wrote:
>
>  Hi,
>
>  I'm programming a C++ Windows application and i'm using gtkmm for the GUI
>  and having the problem
>  that I can not delete any GTK::Widget created (with new).
>
>  I get an Access Violation error in Visual Studio at any widget I want to
>  delete.
>
>  When trying to solve this problem, I made a more simpler gtkmm application.
>  You can find the code below.
>
>  In this application I create a window and show the window. When the window
>  is closed
>  I do the cleanup and delete the window. Result:
>
>  Unhandled exception at 0x77c2b950 in TestWindow.exe: 0x000005:
>  Access violation reading location 0x65552d0e.
>
>  And it is not only the window, but any widget: labels, buttons, frames ...
>
>  Perhaps I do something wrong or I'm missing something, but I can't find the
>  couse of the problem.
>
>
> Many thanks.
>
>
>  OS: Windows Vista business
>  IDE: Visual Studio 2008
>
>  #define WIN32_LEAN_AND_MEAN
>  #include <windows.h>
>  #include <tchar.h>
>
>  #pragma warning(disable: 4250)
>  #undef max
>  #include <gtkmm/main.h>
>  #include <gtkmm/window.h>
>
>  int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,LPTSTR
>  lpCmdLine, int nCmdShow){
>
>         Gtk::Main main (NULL, 0);
>
>         Gtk::Window *window = new Gtk::Window();
>         main.run (*window);
>
>         delete window;  // Unhandled exception at 0x77c2b950 in TestWindow.exe:
>  0x000005:
>         return 0;                            Access violation reading location 0x65552d0e. //
>  }

Did you build gtkmm yourself or did you download a binary?  I'm not
sure how much testing there has been on Vista.  Does it work
differently if you just use a normal main() function instead of that
horrid-looking thing _tWinMain thing? (unfortunately, I have very
little experience with gtkmm on windows, so I don't know what the
standard way of doing things is, but that seems to be something
specific to using the win32 API, which may not be necessary if you're
using gtkmm, I don't know)

Maybe it will work better if you add #define WIN32_BIG_AND_BLOATED
(sorry, bad joke)

Hopefully somebody with a bit more windows experience will chime in...
-- 
jonner


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]