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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:12:59+00:00 2026-06-04T02:12:59+00:00

I am working on a VOIP client (Window’s form) that opens a browser window

  • 0

I am working on a VOIP client (Window’s form) that opens a browser window (ExtendedWebBrowser) when a call is made or received. Normally it works fine but if the computer is put into sleep mode and then woken the program will crash with the following error:

"System.Threading.ThreadStateException crossed a native/managed boundary
  Message=ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment."

I have tried setting threads started in the code with thread.SetApartmentState(ApartmentState.STA) but I am getting the same result. Also, I do have [STAThread] before the main() function. Now I am wondering if it has more to do with a thread not terminating correctly when the computer is put to sleep but I’m not sure. My background is in C++ and DirectX, this is the first Windows form I’ve worked on so any help would be appreciated.

Followup: I was able to resolve this issue after discovering that after resuming the program was being started on a worker thread instead of the main thread. More information can be read here: Sleep(suspend) and Resuming windows form starts program on worker thread instead of main thread

  • 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-06-04T02:13:00+00:00Added an answer on June 4, 2026 at 2:13 am

    I was able to resolve this issue. When the program resumed from sleep mode and run() was called it was being run on the windows event worker thread instead of the main thread. More information can be read here: Sleep(suspend) and Resuming windows form starts program on worker thread instead of main thread

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

Sidebar

Related Questions

I'm working with pbx for voip calls. One aspect of pbx is that you
I am working on a project where we make a VOIP phone call to
I am working on a voip system supposed to work like this: i call
working on xcode I realized that if I create a non-void method, I call
Working on a bunch of forms at the moment and I'm finding that I
Working on a website that has Employee and Branch entities, using a database table
Working on an irc client in Adobe AIR in JavaScript, and thinking about logging.
Working on a movie website and would love to find an API that I
Working on an extension that use the new experimental devtools apis. How do you
Working with a Lucene index, I have a standard document format that looks something

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.