Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2341728
  • 博文数量: 816
  • 博客积分: 10000
  • 博客等级: 上将
  • 技术积分: 5010
  • 用 户 组: 普通用户
  • 注册时间: 2008-12-17 17:57
文章分类

全部博文(816)

文章存档

2011年(1)

2008年(815)

分类:

2008-12-17 18:05:32

#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) |
给主人留下些什么吧!~~