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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:10:22+00:00 2026-05-16T22:10:22+00:00

I have a mixed-mode application in which I want to fire up the debugger

  • 0

I have a mixed-mode application in which I want to fire up the debugger if an error is found in the internal datastructures.
Strange enough, the DebugBreak and __debugbreak functions don’t seem to work as expected (the .Net framework seems to intercept the breakpoint exception, leading to all kinds of nasty side effects).

The solution of my earlier question (see Behavior of DebugBreak differs between unmanaged and mixed (unmanaged+managed) application?) seems to work for very simple situations, but not in my application (it just leaves my application hanging).

Luckily, I found out that executing System::Diagnostics::Debugger::Launch seems to solve the problem. However, the place where I need to have this logic is used in both unmanaged as in mixed-mode applications. Also, calling managed code in the place where I want to put the logic is rather difficult.

Therefore: is there an unmanaged alternative for the System::Diagnostics::Debugger::Launch function?

  • 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-16T22:10:23+00:00Added an answer on May 16, 2026 at 10:10 pm

    It seems to me that the usage of System::Diagnostics::Debugger::Launch is a good point. .NET Debugger like some other .NET classes has also unmanaged interface for example ICorDebug::DebugActiveProcess. It seem to me you should try to use it. You can read more about this in http://msdn.microsoft.com/en-us/magazine/cc301510.aspx. It is will not work, that you can try to write you own small COM interface in .NET with one method only which call System::Diagnostics::Debugger::Launch.

    Another ways is the usage Just-In-Time Debugging and How to: Launch the Debugger Automatically.

    If you don’t need to debug the startup code of your application you can do what you want in very simple way: At the beginning of your application in the main thread (or in all threads which you want to debug) you can display a message box. After you see the message box you can start Visual Studio as Administrator and use “Debug” / “Attach to Process…”. It works very good. If you want to debug a Windows Service you should use WTSSendMessage instead of MessageBox. I am using this way since many years and it work perfect.

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

Sidebar

Related Questions

I have mixed data i nvarchar column (words and numbers). Which is fastest way
I have an application where I would like to have mixed Java and Scala
I have heard mixed responses on this topic, so what is a sure fire
I have a MySQL database of keywords that are presently mixed-case. However, I want
I have an application which is being developed in VS2010, and makes use of
I have created a C++/CLI mixed DLL which I am using from C# Winforms
If I have a 2.0 CLR assembly (pure managed code, no mixed mode issues)
I have heard mixed opinions over the amount of memory that a byte takes
I have a mixed UI (Win App, WPF App, and soon an ASP.NET MVC
I have a solution of mixed VB.NET and C++ projects. When using Visual Studio

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.