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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:32:09+00:00 2026-05-27T02:32:09+00:00

This one is a tough one… I’ve got a C# app that runs an

  • 0

This one is a tough one…

I’ve got a C# app that runs an HTTP server in a BackgroundWorker, it allows users to input data, that should display in real time onto a main form. The HTTP server basically runs in a do/while(true) loop, that always waits for the HTTP response. So it has to run in a BackgroundWorker so that the program does not stop responding while waiting for the web user. However, when the user enters data, I want the background worker to update the data on the main form.

I’ve tried making the functions of the main form public, but this gives a run time exception because the thread accessing the forms controls is not the thread that created them.

I’ve thought about just using the ProgressChanged event of the BW, but I’ve got to pass a lot of data, and it would be nicer to pass more than just a string. Can I override this method, and if I can, how/where would I do it??

Thanks.

  • 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-27T02:32:09+00:00Added an answer on May 27, 2026 at 2:32 am

    Go ahead and use ProgressChanged as-is. It doesn’t really matter how big the object you’re passing as the userState parameter is, as long as:

    • It’s a reference type (that is, not a struct).
    • The background process doesn’t modify its contents after passing back to the main thread, to avoid a race condition.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This one's a tough one - I have a JFrame that generates JTextFields. When
This one is tough to explain inside the title. What I have going on
This is a tough one, and will require some up to date expertise on
I am having a very tough time with this one. I have a Navigation
Now i know that this one is actually not a very technical question but
I'm having a tough time with this one, I have a class which populates
I'm having a tough time wrapping my head around this one. Hovering a navbar
Okay, so this is a tough one, I've spent hours looking for a solution/problem.
This one's tough to explain, so I'll try to show what I'm after using
So I know javascript pretty well, but I'm not sure about this one. Tough

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.