#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include
#include
#include
#include
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
上面是Unit1.h里的定义
一下是我的出错的信息
[C++ Error] Unit1.cpp(20): E2451 Undefined symbol 'Aplication'
[C++ Error] Unit1.cpp(21): E2451 Undefined symbol 'MB_YESNOCANCELIMB_ICONWARNING'
下面是Unit.cpp里的程序
//---------------------------------------------------------------------------
#include
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCloseQuery(TObject *Sender, bool &CanClose)
{
int ExitCode=Aplication->MessageBox("Save editor befor closing?","Warning",
MB_YESNOCANCELIMB_ICONWARNING);
switch(ExitCode)
{
case IDCANCEL:
CanClose=false;
break;
case IDYES:
CanClose=true;
break;
case IDNO:
CanClose=true;
break;
}
//if (MessageDlg("Close the form?", mtConfirmation, TMsgDlgButtons() << mbOK << mbCancel,0) == mrCancel)
// CanClose = false;
}
//Timer1->Enabled=false;
--------------------next---------------------
阅读(1170) | 评论(0) | 转发(0) |