DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: lambdaflow
今日帖子: 1
在线用户: 4
导航: 论坛 -> DELPHI技术 斑竹:liumazi,sephil  
作者:
男 sys007 (sys007) ★☆☆☆☆ -
普通会员
2004/5/2 22:12:34
标题:
求救~~~ 浏览:1312
加入我的收藏
楼主: 我写的程序在退出时报“abstract.error”,这是什么错误,该怎么解决,请教大家了,谢谢!~~~
----------------------------------------------
-
作者:
男 bios (阿贡) ★☆☆☆☆ -
盒子中级会员
2004/5/2 22:17:13
1楼: 贴出你的代码 不然不知道 你的错!
估计是 你对 “纯虚函数的 抽象类”做了 实例化!
----------------------------------------------
按此在新窗口浏览图片
按此在新窗口浏览图片
作者:
男 sys007 (sys007) ★☆☆☆☆ -
普通会员
2004/5/2 22:31:58
2楼: unit login;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, DB, ADODB;

type
  Tloginform = class(TForm)
    Panel1: TPanel;
    Label1: TLabel;
    Label2: TLabel;
    username: TComboBox;
    password: TEdit;
    btnok: TButton;
    btncancel: TButton;
    DataSource1: TDataSource;
    ADOConnection1: TADOConnection;
    ADOQuery_login: TADOQuery;
    procedure btnokClick(Sender: TObject);
    procedure btncancelClick(Sender: TObject);
    procedure usernameDropDown(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  loginform: Tloginform;

implementation
 uses main;
{$R *.dfm}
 var
 itimes:integer=0;

procedure Tloginform.usernameDropDown(Sender: TObject);
var
i:integer;
begin
// 当用户选择已经存在的或用户可以输入数据
username.Clear;
with ADOQuery_login do
begin
  close;
  sql.Clear;
  sql.Add('select * from psw');
  open;
  if recordcount>0 then
  begin
    first;
    for i:=0 to recordcount-1 do
    begin
    username.Items.Add(fieldbyname('用户名').AsString);
    next;
    end;
  end
  else
   showmessage('当前没有用户。请原谅'); //当前没有记录就不能对数据进行操作
end;
end;

procedure Tloginform.btnokClick(Sender: TObject);
var
mima,mingzi:string;
begin
mima:=username.Text; // 用户名
mingzi:=password.Text; //密码
inc(itimes);
if username.Items.Count>0 then
begin
   username.ItemIndex:=0;
   with ADOQuery_login do
     begin
       // 当用户名与密码正确并且输入次数少于三次时就登录成功
       if locate('用户名',mingzi,[lopartialkey]) and locate('密码',mima,[lopartialkey]) and (itimes<4) then
        begin
          close;
          sql.Clear;
          sql.Add('select * from psw where 用户名='''+mingzi+''''+' and  密码='''+mima+'''');
          open;
          application.CreateForm(TmainForm,mainform);
          //mainform.StatusBar1.Panels.Items[1].Text:=name;
          //mainform.StatusBar1.Panels.Items[3].Text:=fieldbyname('权限').AsString;
        if fieldbyname('权限').AsString='操作员' then
            begin
                with mainform do
                begin
                N12.Enabled:=false;
                N13.Enabled:=false;
                N14.Enabled:=false;
                end
            end;
          loginform.Hide;
          loginform.Free;
          mainform.ShowModal;
          mainform.Free;
        end
       else
       begin
         if MessageDlg('密码错误,请重新输入',mtConfirmation, [mbYes, mbNo],0)=mrYes then
           begin
            username.Clear;
            username.SetFocus;
           end
           else
             close;
       end;
       if itimes>3 then
         begin
          showmessage('很抱歉。你没有权力使用本系统');
          application.Terminate;
         end;
     end;
  end
else
 showmessage('数据库没有用户名');
end;

procedure Tloginform.btncancelClick(Sender: TObject);
begin
application.Terminate;
end;

end.


--------------------------------------------------

unit main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, Menus;

type
  Tmainform = class(TForm)
    MainMenu1: TMainMenu;
    N1: TMenuItem;
    N2: TMenuItem;
    N3: TMenuItem;
    N5: TMenuItem;
    N6: TMenuItem;
    N7: TMenuItem;
    N8: TMenuItem;
    N9: TMenuItem;
    N10: TMenuItem;
    N11: TMenuItem;
    N12: TMenuItem;
    N13: TMenuItem;
    N14: TMenuItem;
    N15: TMenuItem;
    StatusBar1: TStatusBar;
    N4: TMenuItem;
    //procedure Exit1Click(Sender: TObject);
    procedure N4Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  mainform: Tmainform;

implementation

{$R *.dfm}

//procedure Tmainform.Exit1Click(Sender: TObject);
//begin
//close;
//end;

procedure Tmainform.N4Click(Sender: TObject);
begin
application.Terminate;
end;

end.



就是在
procedure Tmainform.N4Click(Sender: TObject);
begin
application.Terminate;
end;
退出时报
"abstract.error"

请帮帮我吧!~~~~~


----------------------------------------------
-
作者:
男 sephil (NAILY Soft) ★☆☆☆☆ -
盒子中级会员
2004/5/3 7:20:46
3楼: 问题应该不是出在这里
可能是其他的地方有问题

abstract error是因为你使用了某个类里的纯虚函数
----------------------------------------------
Copyright 2008 ? NAILY Soft

Click here to redirect to my home
Click here to redirect to my blog
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行68.35938毫秒 RSS