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

  • Home
  • SEARCH
  • 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 4608558
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:51:44+00:00 2026-05-22T00:51:44+00:00

Similar problem to last time. I run the code, exit it. The GUI disappears

  • 0

Similar problem to last time. I run the code, exit it. The GUI disappears and it appears to have been fully exited but I check my process list and the code is there still holding memory.

I’ve narrowed it down to a call to wxFileDialog. I don’t understand what I’m doing wrong because I’m calling much in a similar way as I’m calling a wxDialog. The wxDialog call doesn’t result in this problem but the wxFileDialog does cause it.

Works fine:

// Help Dialog
void MyFrame::OnHelp(wxCommandEvent& WXUNUSED(event))
{
    wxBoxSizer *topsizer;
    wxHtmlWindow *html;
    wxDialog dlg(this, wxID_ANY, wxString(_("Help")));

    topsizer = new wxBoxSizer(wxVERTICAL);

    html = new wxHtmlWindow(&dlg, wxID_ANY, wxDefaultPosition,
    wxSize(380, 160), wxHW_SCROLLBAR_NEVER);
    html->SetBorders(0);
    html->LoadPage(wxT("data/help.html"));

    // Fit the HTML window to the size of its contents
    html->SetSize(html->GetInternalRepresentation()->GetWidth(),
                html->GetInternalRepresentation()->GetHeight());

    topsizer->Add(html, 1, wxALL, 10);

    wxButton *but = new wxButton(&dlg, wxID_OK, _("OK"));
    but->SetDefault();

    topsizer->Add(but, 0, wxALL | wxALIGN_RIGHT, 15);

    dlg.SetSizer(topsizer);
    topsizer->Fit(&dlg);

    dlg.CentreOnParent();
    dlg.ShowModal();
}

Causes problem:

void MyFrame::OnVidFile(wxCommandEvent& WXUNUSED(event))
{
    wxString caption = wxT("Choose a file");
    wxString wildcard = wxT("AVI files (*.avi)|*.avi");
    wxString defaultDir = wxGetHomeDir();
    wxString defaultFilename = wxEmptyString;

    wxFileDialog dialog(this, caption, defaultDir, defaultFilename, wildcard, wxOPEN | wxFILE_MUST_EXIST );
    dialog.CentreOnParent();

    if(dialog.ShowModal() == wxID_OK)       // problem
        pathVid = dialog.GetPath().c_str();
}

This results in the program not terminating correctly even if I throw in a dialog.Destroy(); or dialog.Close(); at the end. They look like similar calls to the dialog class to me?

Am I missing something here?

  • 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-22T00:51:44+00:00Added an answer on May 22, 2026 at 12:51 am

    Problem is a conflict with OpenCV (specifically HighGUI).

    To avoid this problem and the OLE error problem, override the WxWidgets initialize base class virtual as follows:

    bool MywxApp::Initialize( int& argc, wxChar **argv ) 
    { 
      ::CoUninitialize(); 
      return wxApp::Initialize( argc, argv ); 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I suppose similar problem would have been discussed here, but I couldn't find it.
I have similar problem to one discussed here , but with stronger practical usage.
I haven't written any code yet, but I've encountered a similar problem before. Hopefully
So, I've been searching around and I've found things similar to my problem, but
Last time I had a similar question, but we figured out if initialize and
I have searched for similar issues but I found nothing... I have a problem
I have a similar problem to this post . I need to display up
I notice this thread: Fastish Python/Jython IPC , and I have a similar problem,
I've got a problem similar to,but subtly different from, that described here (Loading assemblies
My problem is similar to Django Passing Custom Form Parameters to Formset Ive have

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.