Re: Glib error



Alexander wrote:

On Mon, 30 Jan 2006 16:04:39 +0200, Bob Caryl <bob fis-cal com> wrote:

Volosatov Alexander wrote:

I have:

list<Glib::ustring> string_Fish_name;
Gtk::Combo combo_Fish_name;
DB fish_info; //class-interface for DB
//if Connection OK
if (fish_info.DB_Connect("") == -1)
{
    // if query OK
    if (fish_info.DB_SQL_Query("SELECT fish_name FROM t_fish") == -1)
    {
        //if count(row) > 0
        if (fish_info.DB_Result_n() > 0)
        {
            //getting result
            string_Fish_name = fish_info.DB_Result_values(0);
        }
    }
}

combo_Fish_name.set_popdown_strings(string_Fish_name);

ERROR: Glib-ERROR **::gmem.c:174:faild allocate 16 bytes

Sometimes crach after widget.show();
Sometimes after 5-10 seconds.

When I use:
string_Fish_name.push_back("fish one");
string_Fish_name.push_back("fish two");
no prolems.

Problems were only after using access to DB

How to solve?
Please help.
Any questions? - I answer.
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list



Your information is sketchy; but, the = operator for a std::list
requires that its argument be a std::list of the exact same type, so if
the call to DB_Result_values(0) does not return a list<Glib::ustring>
then your results are to be expected.

Bob


It has the same type:

list<Glib::ustring> DB::DB_Result_cols()
{
    list<Glib::ustring> col_name;
if (DB_Status_Result() && (DB_Result_coln() > 0))
    {
        for (int i = 0; i < DB_Result_coln(); ++i)
        {
            col_name.push_back(PQfname(result, i));
        }
    }
return col_name;
}

Aye, but what does "fish_info.DB_Result_values(0)" return?

Bob
begin:vcard
fn:Robert Caryl
n:Caryl;Robert
org:Fiscal Systems, Inc.
adr:;;102 Commerce Circle;Madison;AL;35758;USA
email;internet:bob fis-cal com
title:Senior Software Design Engineer
tel;work:356-772-8920 X108
x-mozilla-html:TRUE
url:http://www.fis-cal.com
version:2.1
end:vcard



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