谁能解释一下C++ Builder XE中的以下“调试器故障通知”是什么意思:
"Project ... faulted with message: 'application-defined exception (code 0x0eefface) at 0x755ad36f. Process Stopped. Use Step or Run to continue."
它仅在我需要抛出异常时发生 - throw 的调用会引发此错误。我找不到有关此问题的任何信息。
抛出异常:
#define MY_ERROR_CODE 0xE0000046
throw TMyTrouble(MY_ERROR_CODE, "My error message"); // calling of this raises the application-defined exception...
捕捉:
try{
Function(); // function that raises the exception TMyTrouble
}
catch(...){ // this catch should catch the exception but it doesn't
// do something
throw; // throw to upper layer
}
异常定义:
class TMyTrouble{
public:
TMyTrouble(int errorCode = 0xFFFFFFFF, AnsiString errorMessage = "Unknown error") { FMessage = errorMessage; FCode = errorCode;}
__property AnsiString Message = {read = FMessage};
__property unsigned long Code = {read = FCode};
private:
unsigned long FCode;
AnsiString FMessage;
};