为什么C++BUILDER在创建出窗口后就不挂了??
Application->Initialize();
Application->MainFormOnTaskBar = true;
Application->CreateForm(__classid(TTestForm), &TestForm);
Application->Run();
//---------------------------------------
void __fastcall TEPSForm::btnDivZeroClick(TObject *Sender)
{
int i=0;
int j=1;
j = j/i;
}
//---------------------------------------
void __fastcall TEPSForm::btnNullPClick(TObject *Sender)
{
char* pData=NULL;
*pData = 1;
}
void __fastcall TForm1::ApplicationEvents1Exception(TObject *Sender, Exception *E)
{
Application->Terminate();
}
try
{
Application->Initialize();
Application->CreateForm(__classid(TForm1), &Form1);
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
catch (...)
{
try
{
throw Exception("");
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
}