Re: gtkmm2.4 and MSVC (again)



i'm finding more details (slowly).
the problem is the casting from the Glib::ObjectBase
to the Gtk::Widget (or others).
here's another test that gives the exact same results.

class A : public Gtk::Window {

   A():Gtk::Window(TOPLEVEL){
      Gtk::Window * w1 = this;
      Glib::ObjectBase * obj =
dynamic_cast<Glib::ObjectBase *>(w1);//this line works
fine
      Gtk::Window * w2 = dynamic_cast<Gtk::Window
*>(obj); //this gives the _non_rtti_object exception
   }

   ~A();


};

class B : public A {

   B():A(){}
   int i;//commenting this eliminates the exception
};

if we can figure out why this is happening, it'll fix
the problem.
i tried changing what class A extends (Gtk::Widget,
Gtk::Object, etc) just to see if i can cast back and
forth.  the same results.  (i'm not sure, but i think
when i made class A extend Glib::Object the casting
worked).
i do get warnings in compiling that says Gtk::Window,
Bin, Container, and Widget inherit set_manage() and
destroy_notify_() by dominance.  i'm not sure if this
could be the problem.

any ideas?
thanks for all your help!
--Matt

--- Roger Leigh <rleigh whinlatter ukfsn org> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Cedric Gustin <cedric gustin swing be> writes:
> 
> > class MyHelloWorld : public HelloWorld
> > {
> > public:
> > 	MyHelloWorld() {}
> 
> Does
>         MyHelloWorld(): HelloWorld() {}
> change anything?
> 
> It might just be you didn't chain up to the base
> class constructor?
> 
> > 	virtual ~MyHelloWorld() {}
> >
> > private:
> > 	int i;  // comment this out and helloworld does
> not crash !
> > };
> 
> 
> - -- 
> Roger Leigh
>                 Printing on GNU/Linux? 
> http://gimp-print.sourceforge.net/
>                 Debian GNU/Linux       
> http://www.debian.org/
>                 GPG Public Key: 0x25BFB848.  Please
> sign and encrypt your mail.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.5 (GNU/Linux)
> Comment: Processed by Mailcrypt 3.5.8
> <http://mailcrypt.sourceforge.net/>
> 
>
iD8DBQFBhqibVcFcaSW/uEgRAm+QAJkB0Cpk20kRSlXNTfRlbDEFfUZ/vgCgoVZ9
> p0ehPxF9Cu87c7tfakvKh3k=
> =2ymi
> -----END PGP SIGNATURE-----
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



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