Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4271884
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:30:10+00:00 2026-05-21T07:30:10+00:00

I am getting a database table value in wxListCtrl, (data can be large so

  • 0

I am getting a database table value in wxListCtrl, (data can be large so I am using wxThread) Child thread send row to Main thread and main thread fill it in wxListCtrl,
everything is going good but when I m trying to close the frame , it is giving me unexpected result. at the close button , I am invoking a new frame, sometime it opens and some time not, my code is:-

 if(thread_object_holder->IsAlive())
        {
            wxPuts(wxT("live"));
            thread_object_holder->Pause();
            wxMessageDialog *msg = new wxMessageDialog(this,wxT("You want to quit"), wxT("Quit Login Report") ,wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION);
            if ( msg->ShowModal() == wxID_YES )
            {
                thread_object_holder->Delete();
                temp_back_frame *obj= new temp_back_frame();
                this->Destroy();
                obj->Show(true);
            }
            else
            {
                thread_object_holder->Resume();
            }
        }
        else
        {
            wxPuts(wxT("dead"));
            wxMessageDialog *msg = new wxMessageDialog(this,wxT("You want to quit"), wxT("Quit Login Report") ,wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION);
            if ( msg->ShowModal() == wxID_YES )
            {
                thread_object_holder->Delete();
                temp_back_frame *obj= new temp_back_frame();
                this->Destroy();
                obj->Show(true);
            }

        } 

there are only 7 row in table, during the filling record if I press the button, everything is fine there but once 7 row placed in ListCtrl { I think now thread will be destroy } , me no data to put to listctrl, we press close button then sometime new frame open, some time frame hang, I THINK THREAD IS RESPONSIBLE FOR THIS BUT HERE I TAKE PROPER PRECAUTION TO HANDLE THE THREAD, please let me know, where I am wrong.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T07:30:11+00:00Added an answer on May 21, 2026 at 7:30 am

    Basicially problem was Thread, wxThread, by default thread is Detatched , it automatically delete when finish working. here during thread alive when we check if( obj->IsAlive ) , no problem but when thread end then we checked this
    `
    if(obj -> IsAlive )
    showing problem because when thread delete , there are no object of thread.still we are checking this. [ it was the main problme ]. i use a extern variable to check thread is live or dead , now my code is working fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using a particular database table like a Set data structure, i.e., you can
I am using this code to create a database. But I am getting false
I have couple of rows in database table (lets call it Customer), each row
Ever since I cleaned the data on the SQL Database I've been getting this
I am creating a database to store the value in table with a primary
I am trying to get the database values and binding to data table by
I want to rename a database, but keep getting the error that 'couldn't get
I'm having a problem getting access to a database which lives on a remote
Say for example you're getting a web app project that interacts with a database.
Here's the problem: In C# I'm getting information from a legacy ACCESS database. .NET

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.