Re: Load Glade with libglademm library in VS 2005 Beta 2 Error

"Diego Martinez" <[email protected]> Mon, 20 Feb 2006 09:17:29 +0100
Newsgroups gmane.comp.gnome.gnomemm
Message-ID <[email protected]>
--===============0877882970==
Content-Type: multipart/alternative; 
	boundary="----=_Part_2861_10090209.1140423449014"

------=_Part_2861_10090209.1140423449014
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

I'm from spain and my english is very bad, so sorry if
 i don't speak very well.

I'm using VS 2005 Beta 2 with gtkmm-devel-2.8.3-1.exe and
gtk-win32-devel-2.8.10-rc1.exe.

When i install gtk-win32-devel-2.8.10-rc1.exe don't detect visual
studio enviroment but my problem is that i install this packet ok?,
and choose cygwin enviroment because i can't choose other. Then i
create a win32 console proyect to use with gtkmm and i want load xml
glade file.

The code that i'm using is very simple but when i try to load xml file
with:

Glib::RefPtr<Gnome::Glade::Xml xmlptr =3D
Gnome::Glade::Xml::create("/data/prueba.glade",NULL,NULL);

>  or



Glib::RefPtr<Gnome::Glade::Xml> xmlptr =3D  Gnome::Glade::Xml::create("
prueba.glade");
 the vs2005 crash when i execute with the follown error:
            Unhandled exception at 0x781442d0 (msvcr80.dll) in PruebaGUI.ex=
e:
0xC0000005: Access violation reading location 0x00000000.
            Unhandled exception at 0x781442d0 (msvcr80.dll) in
PruebaGUI.exe:> 0xC0000005: Access violation reading location 0x00000000.
            Unhandled exception at 0x781442d0 (msvcr80.dll) in
PruebaGUI.exe:> 0xC0000005: Access violation reading location 0x00000000.

This error ocurred into msvcr80.dll and i'm reading a lot of and after two
days i don't know waht happen. I'd like if you help me because it's necesar=
y
load xml glade file with  vs2005 to my technical degree project. Very very
thanks for your help and sorry because i'm wasting your  time.

>
>
> > The code is:
> >
> > #include <gtkmm.h>
> > #include <libglademm.h>
> > #include <libglademm/xml.h>
> > #include <iostream>
> >
> > class Simple : public Gtk::Window
> > {
> >     public:
> >         Simple(BaseObjectType* base_object,
> >             const Glib::RefPtr<Gnome::Glade::Xml>& glade_xml);
> >         virtual ~Simple();
> >
> >     protected:
> >       //Signal handlers:
> >       virtual void on_button1_clicked();
> >
> >       //Member widgets:
> >       Glib::RefPtr<Gnome::Glade::Xml> glade;
> >         Gtk::Entry *e;
> > };
> >
> > void Simple::on_button1_clicked()
> > {
> >   std::cout << e->get_text() << std::endl;
> >   e->set_text("");
> > }
> >
> >
> > Simple::Simple(BaseObjectType* base_object,
> >                                 const Glib::RefPtr<Gnome::Glade::Xml>&
> > glade_xml) :
> >     Gtk::Window(base_object)
> > {
> >     glade=3Dglade_xml;
> >     Gtk::Button *btnB1;
> >     glade->get_widget("button1", btnB1);
> >     btnB1->signal_clicked().connect(sigc::mem_fun(*this,
> > &Simple::on_button1_clicked));
> >
> >     glade->get_widget("entry1", e);
> > }
> >
> > Simple::~Simple() {
> >
> > }
> >
> > int main (int argc, char *argv[])
> > {
> >     Gtk::Main kit(argc, argv, false);
> >
> >     Glib::RefPtr<Gnome::Glade::Xml> xmlptr =3D
> >             Gnome::Glade::Xml::create("/data/prueba.gui",NULL,NULL);
> >
> >     Simple *simple;
> >
> >     xmlptr->get_widget_derived("window1", simple);
> >     Gtk::Main::run(*simple);
> >     return 0;
> > }
>


2006/2/17, Murray Cumming <[email protected]>:
>
> Please use the mailing list.
>
> On Fri, 2006-02-17 at 17:54 +0100, Diego Martinez wrote:
> --
> Murray Cumming
> [email protected]
> www.murrayc.com
> www.openismus.com
>
>

------=_Part_2861_10090209.1140423449014
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

I'm from spain and my english is very bad, so sorry if<br>
&nbsp;i don't speak very well.<br>
<br>
I'm using VS 2005 Beta 2 with gtkmm-devel-2.8.3-1.exe and<br>
gtk-win32-devel-2.8.10-rc1.exe.<br>
<br>
When i install gtk-win32-devel-2.8.10-rc1.exe don't detect visual<br>
studio enviroment but my problem is that i install this packet ok?,<br>
and choose cygwin enviroment because i can't choose other. Then i<br>
create a win32 console proyect to use with gtkmm and i want load xml<br>
glade file.<br>
<br>
The code that i'm using is very simple but when i try to load xml file<br>
with:<br>
<br>
Glib::RefPtr&lt;Gnome::Glade::Xml xmlptr =3D&nbsp; Gnome::Glade::Xml::creat=
e(&quot;/data/prueba.glade&quot;,NULL,NULL);<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&nbsp;or</blockqu=
ote>
<div><br>
<br>
</div>Glib::RefPtr&lt;Gnome::Glade::Xml&gt; xmlptr =3D&nbsp; Gnome::Glade::=
Xml::create(&quot;prueba.glade&quot;);<br>
&nbsp;the vs2005 crash when i execute with the follown error: <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Unhandled exception at 0x781442d0 (msvcr80.dll) in PruebaGUI.exe:
0xC0000005: Access violation reading location 0x00000000.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Unhandled exception at 0x781442d0 (msvcr80.dll) in PruebaGUI.exe:&gt;
0xC0000005: Access violation reading location 0x00000000.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Unhandled exception at 0x781442d0 (msvcr80.dll) in PruebaGUI.exe:&gt;
0xC0000005: Access violation reading location 0x00000000.<br>
&nbsp;&nbsp; <br>
This error ocurred into msvcr80.dll and i'm reading a lot of and after
two days i don't know waht happen. I'd like if you help me because it's
necesary load xml glade file with&nbsp; vs2005 to my technical degree
project. Very very thanks for your help and sorry because i'm wasting
your&nbsp; time.<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br>&gt; The =
code is:<br>&gt;<br>&gt; #include &lt;gtkmm.h&gt;<br>&gt; #include &lt;libg=
lademm.h
&gt;<br>&gt; #include &lt;libglademm/xml.h&gt;<br>&gt; #include &lt;iostrea=
m&gt;<br>&gt;<br>&gt; class Simple : public Gtk::Window<br>&gt; {<br>&gt;&n=
bsp;&nbsp;&nbsp;&nbsp; public:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp; Simple(BaseObjectType* base_object,<br>&gt;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const Glib::RefPtr&lt;=
Gnome::Glade::Xml&gt;&amp; glade_xml);
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; virtual ~Simple();=
<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; protected:<br>&gt;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp; //Signal handlers:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp; virtual void on_button1_clicked();<br>&gt;<br>&gt;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp; //Member widgets:<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp; Glib::RefPtr&lt;Gnome::Glade::Xml&gt; glade;
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Gtk::Entry *e;<br>=
&gt; };<br>&gt;<br>&gt; void Simple::on_button1_clicked()<br>&gt; {<br>&gt;=
&nbsp;&nbsp; std::cout &lt;&lt; e-&gt;get_text() &lt;&lt; std::endl;<br>&gt=
;&nbsp;&nbsp; e-&gt;set_text(&quot;&quot;);<br>&gt; }<br>
&gt;<br>&gt;<br>&gt; Simple::Simple(BaseObjectType* base_object,<br>&gt;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
const Glib::RefPtr&lt;Gnome::Glade::Xml&gt;&amp;<br>&gt; glade_xml) :<br>&g=
t;&nbsp;&nbsp;&nbsp;&nbsp; Gtk::Window(base_object)<br>&gt; {<br>&gt;&nbsp;=
&nbsp;&nbsp;&nbsp; glade=3Dglade_xml;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Gtk::=
Button *btnB1;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; glade-&gt;get_widget(&quot;b=
utton1&quot;, btnB1);
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; btnB1-&gt;signal_clicked().connect(sigc::m=
em_fun(*this,<br>&gt; &amp;Simple::on_button1_clicked));<br>&gt;<br>&gt;&nb=
sp;&nbsp;&nbsp;&nbsp; glade-&gt;get_widget(&quot;entry1&quot;, e);<br>&gt; =
}<br>&gt;<br>&gt; Simple::~Simple() {
<br>&gt;<br>&gt; }<br>&gt;<br>&gt; int main (int argc, char *argv[])<br>&gt=
; {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Gtk::Main kit(argc, argv, false);<br>&g=
t;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Glib::RefPtr&lt;Gnome::Glade::Xml&gt; xm=
lptr =3D<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp; Gnome::Glade::Xml::create(&quot;/data/prueba.gui&quot;,NULL,N=
ULL);
<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Simple *simple;<br>&gt;<br>&gt;&nb=
sp;&nbsp;&nbsp;&nbsp; xmlptr-&gt;get_widget_derived(&quot;window1&quot;, si=
mple);<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Gtk::Main::run(*simple);<br>&gt;&nbs=
p;&nbsp;&nbsp;&nbsp; return 0;<br>&gt; }<br></blockquote>
<br><br><div><span class=3D"gmail_quote">2006/2/17, Murray Cumming &lt;<a h=
ref=3D"mailto:[email protected]">[email protected]</a>&gt;:</span><bloc=
kquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 204, =
204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Please use the mailing list.<br><br>On Fri, 2006-02-17 at 17:54 +0100, Dieg=
o Martinez wrote:<br>--<br>Murray Cumming<br><a href=3D"mailto:murrayc@murr=
ayc.com">[email protected]</a><br><a href=3D"http://www.murrayc.com">www.=
murrayc.com
</a><br><a href=3D"http://www.openismus.com">www.openismus.com</a><br><br><=
/blockquote></div><br>

------=_Part_2861_10090209.1140423449014--

--===============0877882970==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
gnomemm-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gnomemm-list

--===============0877882970==--