External exception EEFFACE问题
一个异常问题。。不知道为什么会抛出exception EEFFACE?请教大家。。。
void __fastcall TForm1::BitBtn1Click(TObject *Sender)
{
int x;
try
{
x = Edit1->Text.ToInt();
if (x == 1)
{
throw new MyException("抛出啦");
}
}
catch(MyException &myException)
{
ShowMessage(myException.test);
}
}
class MyException
{
public:
String test;
MyException(String Message)
{
test = Message;
}
};
class MyException: public Exception
{
public:
String test;
MyException(String strMessage): Exception(strMessage)
{
test = strMessage;
}
};
void __fastcall TForm1::Button1Click(TObject *Sender)
{
int x;
try
{
x = Edit1->Text.ToInt();
if (x == 1)
{
throw MyException("抛出啦");
}
}
catch (MyException &myException)
{
ShowMessage(myException.test);
}
}