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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:46:38+00:00 2026-05-22T11:46:38+00:00

A C# code retrieves a property value from a C++ dll and this retrieval

  • 0

A C# code retrieves a property value from a C++ dll and this retrieval blocks the current thread until the dll returns the value. In debug mode, when the retrieval takes a long time, the MDA throws a ContextDeadlockSwitch.

I suppose it’s not possible to catch ContextDeadlockSwitch at runtime, but is there a way that the a mechanism similar to MDA can throw a similar exception that C# can catch to detect this deadlock?

The reason is to let C# code prompt to the user to either continue waiting a few seconds more or forcibly kill and restart the app.

  • 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-22T11:46:38+00:00Added an answer on May 22, 2026 at 11:46 am

    You could perform the call into the C++ dll in a different thread, using a wait with timeout on a
    ManualResetEvent
    to signal completion; if the timeout is reached you can ask the user if they want to continue. Note that if the DLL’s COM object is in a STA, you may need to create the object in an apartment reserved for it and marshall across, in order to prevent it from freezing your GUI thread when it goes out to lunch.

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

Sidebar

Related Questions

I have some existing code that retrieves data from a database using ADO.NET that
When I retrieve any Scalar value from the database, I usually write code like
Here is a sample code to retrieve data from a database using the yield
I want to analyze an SQL Server stored procedure from .NET code to retrieve
I'm using TNMHTTP in Delphi to retrieve the code from a webpage. The code
I'm using the following code within the JCProperty class to retrieve data from a
Code I have: cell_val = CStr(Nz(fld.value, )) Dim iter As Long For iter =
From http://csharpindepth.com/Articles/Chapter8/PropertiesMatter.aspx using System; struct MutableStruct { public int Value { get; set; }
I have a C# program that executes a thread. Inside this thread, I have
To retrieve data from ActiveDirectory I used the following code: SPSecurity.RunWithElevatedPrivileges(delegate() ( var currentDirectory

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.