可能有人給我解釋一下什麼是以下「調試器故障通知」意味着C++ Builder的XE:應用程序定義的異常
"Project ... faulted with message: 'application-defined exception (code 0x0eefface) at 0x755ad36f. Process Stopped. Use Step or Run to continue."
,當我需要拋出一個異常,只發生 - 拋調用引發這個錯誤。 我找不到有關此問題的任何信息。
拋出異常的:
#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;
};
是否有一個'catch'處理引發的異常? – hmjd 2012-04-10 11:12:59
是的,但它沒有捕獲任何東西 - 那是什麼奇怪 – Martinique 2012-04-10 11:27:14
你可以發佈'throw'和'catch'代碼加異常定義嗎? – hmjd 2012-04-10 11:31:53