|
发表于 2020-7-12 18:00:01
|
显示全部楼层
试了一下你的代码,没有问题
class TPart1
{
public:
void __fastcall Function_1( void )
{
const String Error_Str = "Error Of F1.";
throw ( Error_Str );
}
};
class TCombination
{
public:
TCombination( );
void __fastcall Act( void );
};
// *.h
TPart1 *A_Part;
TCombination::TCombination()
{
A_Part = new TPart1( );
}
void __fastcall TCombination::Act( void )
{
try
{
A_Part->Function_1( ); // 程序执行这一句之后,死掉了.
}
catch( ... )
{
ShowMessage( "Errors Found." );
}
}
int main(int argc, char* argv[])
{
TCombination c;
c.Act();
return 0;
}
|
|