什么是“ Microsoft C ++异常”? [英] What is a "Microsoft C++ exception"?

查看:426
本文介绍了什么是“ Microsoft C ++异常”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这主要是出于好奇,但是在调试时,我经常看到这样的一行:


MyApp.exe中的0x7583812f:Microsoft C ++异常:内存位置0x039be09c中的CTBadSupportFileException。


我不知道为什么将其称为微软的C ++异常?



这真的是正常的C ++异常吗?它来自什么类别?

调试器为什么会像这样记录它们?

是 Microsoft C ++异常是异常的类型,还是像CTBadSupportFileException这样的异常派生的父类型? / p>

解决方案

这不是 Microsoft C ++异常。这是 Microsoft C ++异常。



使用 RaiseException 函数引发操作系统异常时,调用方指定一个异常代码。有一些标准的异常代码,例如用于堆栈溢出的0xC00000FD或用于访问冲突的0xC0000005。但是,您也可以引发自定义异常代码,并且Microsoft C ++工具链对所有C ++异常使用的自定义异常代码为0xE06d7363。



请注意,操作系统异常和C ++异常是不同的概念。调试器中的消息正在谈论操作系统异常。



调试器是在礼貌地对待您,而不是报告 Exception 0xE06d7363,而是显示 Microsoft C ++异常,甚至还需要采取额外的步骤解码其参数为您。


This is mostly out of curiosity, but when debugging, I often see a line looking like that:

First-chance exception at 0x7583812f in MyApp.exe: Microsoft C++ exception: CTBadSupportFileException at memory location 0x039be09c..

And I wonder, why is it called a "Microsoft" C++ exception?

Is it really a normal C++ exception? What class does it derive from? Is "Microsoft C++ exception" the type of the exception, or is it a parent type from which exceptions like CTBadSupportFileException derive?

Why does the debugger log them like that?

解决方案

It is not a "Microsoft" C++ exception. It is a "Microsoft C++" exception.

When an operating system exception is raised with the RaiseException function, the caller specifies an exception code. There are some standard exception codes like 0xC00000FD for stack overflow or 0xC0000005 for access violation. But you can also raise custom exception codes, and the custom exception code used by the Microsoft C++ toolchain for all C++ exceptions is 0xE06d7363.

Note that operating system exceptions and C++ exceptions are different concepts. The message in the debugger is talking about operating system exceptions.

The debugger is doing you a courtesy and instead of reporting "Exception 0xE06d7363" it says "Microsoft C++ exception", and it even takes the extra step of decoding its parameters for you.

这篇关于什么是“ Microsoft C ++异常”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆