I need to launch a debugger from my native C++ program when certain conditions are met. In C# I just call System.Diagnostics.Debugger.Launch(). I thought that Win32 DebugBreak()
DebugBreak() is fine, so is the __debugbreak() intrinsic. They both do the same thing, they crash the program with a STATUS_BREAKPOINT exception. Which then triggers the Windows Error Reporting dialog, it trundles for a while then offers the Debug button. Which then starts the debugger.
The only real mistake you could make is not waiting long enough for the WER dialog and pressing Cancel too quick. Or having WER disabled. If there is no debugger available at all then, yes, you don't get to choose one.
The registry key that matters is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger. Normally set to vsjitdebugger.exe, the one that displays the "Possible debuggers" dialog.