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 5934725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:09:14+00:00 2026-05-22T15:09:14+00:00

To batch upload many files, there is one section of CSharp WPF code that

  • 0

To batch upload many files, there is one section of CSharp WPF code that I have which spawns threads to allow parallel uploading of files.
If an error occurs with the upload, a message would be popped up using MessageBox. This works fine.

But now recently we’ve decided to customize the look of the MessageBox. I find when our new custom WPF MessageBox window is opened with ShowDialog() that an error is thrown saying that it isn’t possible to launch a GUI. This only happens when code from the spawned thread attempts to open the custom Message window — I don’t see the problem when a custom MessageBox opens from the main thread.

My temporary fix is to catch any errors that occur when the custom dialog is launched and to alternatively call the standard MessageBox.Show() to display the message. That works.

I’m not sure why it’s OK to use the standard MessageBox.Show() but it isn’t for the custom window. Is there a way to get around this?

  • 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-22T15:09:15+00:00Added an answer on May 22, 2026 at 3:09 pm

    Generally (in any GUI-API) don’t call GUI functions from worker threads and don’t do heavy work on GUI threads.
    The fact that the standard MessageBox works on a worker thread is sad.

    Yes, you are completely right. When on your worker thread somethings happens that needs to be displayed to the user, send a notification (signal, event, whatever your Framework calls it) to the GUI thread and display the message there.

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

Sidebar

Related Questions

I have a few batch files I need to run frequently in developing a
Is there a FOSS batch compiling solution for Delphi that takes version as an
I wrote a batch script which recursively updates my source code against the company's
Some batch files on Windows use an IF syntax with multiple lines, as below:
I would like a batch file to launch two separate programs then have the
I have a batch file (in windows XP, with command extension activated) with the
I am building php web application that let's a user upload a MS Access
I'm trying to do a batch upload of photos in my iPhone application. I
I've been trying to write a ruby script using mechanize to batch upload a
I wrote a simple batch file as a PowerShell script, and I am getting

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.