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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:11:35+00:00 2026-05-15T11:11:35+00:00

I am raising an event from managed C++ which is handled by a C#

  • 0

I am raising an event from managed C++ which is handled by a C# app.
Is the C# event handler executed on the same thread it was raised from C++ ??

In other words, Is raising event blocking for C++ until it is completely handled by C#?

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

    Event handler invocation is synchronous by default in .NET, and since your code is both Managed C++ and C#, it is all “.NET”.

    If you wish your event handlers to function asynchronously, you could simply attach a handler on the C# side that either starts another Thread to do the work, drops a worker into ThreadPool, or invokes another method to handle the work asynchronously via a Delegate using asynchronous programming. The handler would then return quickly, allowing the C# work to execute in the background while the MC++ code can continue invoking other listeners of the event.

    Make sure that if you do execute the code that actually handles the event asynchronously, that the C++ code does not expect data in the event arguments to be modified by the handlers. This would be the case if something like CancelEventArgs were used.

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

Sidebar

Related Questions

The main problem is, that raising an event from one thread can invoke delegates
Raising an event, will call its event handler. eg http://msdn.microsoft.com/en-us/library/aa645739%28VS.71%29.aspx What is the difference
I need to raise an event from a form on a new thread. (I
I'm a little confused about raising an event in Objective-C, I came from C#
what is the advantage of raising and event in asp.net user controls?
Is it normal firebird server sends all registered event counts on raising any of
Raising events in multithreaded classes? I am running a class(gamepad handler) that uses many
Is it possible to kill a Java thread without raising an exception in it?
This question is only related to the first parameter in any event handler, that
I need somebody with high skills in threading and event raising. I have an

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.