[red]我在装了Ddelphi 的机子上试了一下,也不行这是怎么会事吗??
在WIN98下,安装在别人的机子上系统报错为:该程序执行了非法操作,即将关闭,如有问题请与程序供应商联系!!
在WINDOWS2000下,安装在别人的机子上系统报错为:WINDOW创建了错误程序,须重新启动后在运行!!!但初始的封面能显示出来!!!
在WINDOWXP下,初始的封面显示出来后,就消失了!!也没有报错信息!!![/red]
是不是我做的程序有问题呀??我把源码贴出来给大家看看,帮帮忙吧!!!
所用控件:Delphi自带+XPMENU +DevExpresExpressQuantumGriPrv3.2.Suit for Delphi
源码如下:
[blue]unit main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, XPMenu, ExtCtrls, ToolWin, ComCtrls, StdCtrls, DBCtrls, Spin,
dxExEdtr, dxEdLib, dxDBELib, dxCntner, dxEditor, dxTL, dxDBCtrl, dxDBGrid,
Buttons, Menus, dxDBTLCl, dxGrClms, DB, ADODB;
type
TSaveMethod = procedure (const FileName: String;
ASaveAll: Boolean) of object;
TFrm_main = class(TForm)
XPMenu1: TXPMenu;
ControlBar1: TControlBar;
ToolBar1: TToolBar;
ToolButton2: TToolButton;
ToolButton5: TToolButton;
ToolButton7: TToolButton;
Panel1: TPanel;
GroupBox4: TGroupBox;
Label3: TLabel;
Label5: TLabel;
Label2: TLabel;
GroupBox1: TGroupBox;
DBRadioGroup8: TDBRadioGroup;
GroupBox3: TGroupBox;
Label4: TLabel;
Label7: TLabel;
DBRadioGroup1: TDBRadioGroup;
DBRadioGroup2: TDBRadioGroup;
Panel2: TPanel;
DBRadioGroup3: TDBRadioGroup;
DBRadioGroup5: TDBRadioGroup;
DBRadioGroup7: TDBRadioGroup;
DBRadioGroup6: TDBRadioGroup;
dxSpin_week: TdxDBSpinEdit;
dxSpin_sn: TdxDBSpinEdit;
dxSpin_group: TdxDBSpinEdit;
dxSpin_distance: TdxDBSpinEdit;
dxEditStyleController1: TdxEditStyleController;
Label1: TLabel;
Panel3: TPanel;
DBNavigator1: TDBNavigator;
Panel4: TPanel;
StatusBar1: TStatusBar;
dxDBGrid1: TdxDBGrid;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
BitBtn4: TBitBtn;
BitBtn5: TBitBtn;
BitBtn6: TBitBtn;
ToolBar2: TToolBar;
ADOConnection1: TADOConnection;
ADOTable1: TADOTable;
DataSource1: TDataSource;
dxDBGrid1ID: TdxDBGridMaskColumn;
dxDBGrid1Week: TdxDBGridColumn;
dxDBGrid1Date: TdxDBGridDateColumn;
dxDBGrid1Time: TdxDBGridColumn;
dxDBGrid1SN: TdxDBGridColumn;
dxDBGrid1Group: TdxDBGridColumn;
dxDBGrid1Distance: TdxDBGridColumn;
dxDBGrid1Intensity: TdxDBGridColumn;
dxDBGrid1Mode: TdxDBGridColumn;
dxDBGrid1Equipment: TdxDBGridColumn;
dxDBGrid1Timeload: TdxDBGridColumn;
dxDBGrid1Swimpool: TdxDBGridColumn;
dxDBGrid1Description: TdxDBGridMemoColumn;
dxDBMemo1: TdxDBMemo;
dxDBDateEdit1: TdxDBDateEdit;
dxDBGrid1Amount: TdxDBGridColumn;
SaveDialog: TSaveDialog;
cbSaveAll: TdxCheckEdit;
BitBtn7: TBitBtn;
BitBtn8: TBitBtn;
BitBtn9: TBitBtn;
BitBtn10: TBitBtn;
BitBtn11: TBitBtn;
ToolBar3: TToolBar;
ToolButton1: TToolButton;
ToolButton3: TToolButton;
ToolButton4: TToolButton;
ToolButton6: TToolButton;
ToolButton8: TToolButton;
ToolButton9: TToolButton;
MainMenu1: TMainMenu;
files: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
N5: TMenuItem;
A1: TMenuItem;
N6: TMenuItem;
P1: TMenuItem;
V1: TMenuItem;
N7: TMenuItem;
X1: TMenuItem;
database: TMenuItem;
N9: TMenuItem;
N10: TMenuItem;
X2: TMenuItem;
Y1: TMenuItem;
Z1: TMenuItem;
N11: TMenuItem;
Excel1: TMenuItem;
HTLM1: TMenuItem;
statistics: TMenuItem;
N13: TMenuItem;
S1: TMenuItem;
plan: TMenuItem;
N15: TMenuItem;
N16: TMenuItem;
N17: TMenuItem;
information: TMenuItem;
N19: TMenuItem;
help: TMenuItem;
N21: TMenuItem;
procedure FormCreate(Sender: TObject);
procedure ToolButton8Click(Sender: TObject);
procedure BitBtn4Click(Sender: TObject);
procedure BitBtn6Click(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
procedure BitBtn5Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure ADOTable1AfterDelete(DataSet: TDataSet);
procedure ADOTable1AfterPost(DataSet: TDataSet);
procedure BitBtn7Click(Sender: TObject);
private
procedure Save(ADefaultExt, AFilter, AFileName: String;
AMethod: TSaveMethod);
public
{ Public declarations }
end;
var
Frm_main: TFrm_main;
implementation
uses sta;
{$R *.dfm}
procedure TFrm_main.FormCreate(Sender: TObject);
begin
Frm_main.Height:=680;
Frm_main.Width:=880;
Frm_main.Position:=poScreencenter;
Frm_main.AutoSize:=True;
SaveDialog.InitialDir := ExtractFilePath(Application.ExeName);
end;
procedure TFrm_main.Save(ADefaultExt, AFilter, AFileName: String;
AMethod: TSaveMethod);
begin
with SaveDialogdo
begin
DefaultExt := ADefaultExt;
Filter := AFilter;
FileName := AFileName;
if Execute then
AMethod(FileName, cbSaveAll.Checked);
end;
end;
procedure TFrm_main.ToolButton8Click(Sender: TObject);
begin
Frm_sta.Show;
end;
procedure TFrm_main.BitBtn4Click(Sender: TObject);
begin
ADOTable1.Cancel;
end;
procedure TFrm_main.BitBtn6Click(Sender: TObject);
begin
ADOTable1.Delete;
end;
procedure TFrm_main.BitBtn3Click(Sender: TObject);
begin
ADOTable1.Open;
ADOTable1.Active:=True;
ADOTable1.Edit;
ADOTable1.FieldByName('Amount').AsInteger:=dxSpin_group.IntValue*dxSpin_distance.IntValue;
ADOTable1.Post;
ADOTable1.Refresh;
ADOTable1.Active:=False;
ADOTable1.Close;
BitBtn3.Enabled:=False;
BitBtn4.Enabled:=False;
BitBtn5.Enabled:=True;
BitBtn6.Enabled:=True;
end;
procedure TFrm_main.BitBtn5Click(Sender: TObject);
begin
BitBtn5.Enabled:=False;
BitBtn6.Enabled:=False;
BitBtn3.Enabled:=True;
BitBtn4.Enabled:=True;
begin
ADOTable1.Open;
ADOTable1.Active:=True;
ADOTable1.Append;
end;
end;
procedure TFrm_main.BitBtn1Click(Sender: TObject);
begin
Save('xls', 'Microsoft Excel 4.0 Worksheet (*.xls)|*.xls', 'ExpGrid.xls', dxDBGrid1.SaveToXLS);
end;
procedure TFrm_main.BitBtn2Click(Sender: TObject);
begin
Save('htm', 'HTML File (*.htm;
*.html)|*.htm', 'ExpGrid.htm', dxDBGrid1.SaveToHTML);
end;
procedure TFrm_main.ADOTable1AfterDelete(DataSet: TDataSet);
begin
Frm_main.StatusBar1.SimpleText:=Format('有%d条记录',[DataSet.RecordCount]);
end;
procedure TFrm_main.ADOTable1AfterPost(DataSet: TDataSet);
begin
Frm_main.StatusBar1.SimpleText:=Format('有%d条记录',[DataSet.RecordCount]);
end;
procedure TFrm_main.BitBtn7Click(Sender: TObject);
begin
Frm_sta.Show;
end;
[/blue]
unit sta;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, XPMenu, StdCtrls, dxCntner, dxTL, dxDBCtrl, dxDBGrid,
DB, ADODB, dxDBTLCl, dxGrClms;
type
TFrm_sta = class(TForm)
PageControl1: TPageControl;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
TabSheet3: TTabSheet;
TabSheet4: TTabSheet;
TabSheet5: TTabSheet;
TabSheet6: TTabSheet;
TabSheet7: TTabSheet;
XPMenu1: TXPMenu;
GroupBox1: TGroupBox;
Btn_in_s: TButton;
Btn_in_r: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
GroupBox2: TGroupBox;
dxDBGrid1: TdxDBGrid;
GroupBox3: TGroupBox;
GroupBox4: TGroupBox;
Btn_e_s: TButton;
GroupBox5: TGroupBox;
GroupBox6: TGroupBox;
GroupBox7: TGroupBox;
GroupBox8: TGroupBox;
GroupBox9: TGroupBox;
GroupBox10: TGroupBox;
GroupBox11: TGroupBox;
GroupBox12: TGroupBox;
GroupBox13: TGroupBox;
GroupBox14: TGroupBox;
Btn_e_r: TButton;
Button9: TButton;
Button10: TButton;
Button11: TButton;
Button12: TButton;
Btn_s_s: TButton;
Btn_s_r: TButton;
Button15: TButton;
Button16: TButton;
Button17: TButton;
Button18: TButton;
Btn_t_s: TButton;
Btn_t_r: TButton;
Button21: TButton;
Button22: TButton;
Button23: TButton;
Button24: TButton;
Btn_p_s: TButton;
Btn_p_r: TButton;
Button27: TButton;
Button28: TButton;
Button29: TButton;
Button30: TButton;
Btn_d_s: TButton;
Btn_d_r: TButton;
Button33: TButton;
Button34: TButton;
Button35: TButton;
Button36: TButton;
Btn_m_s: TButton;
Btn_m_r: TButton;
Button39: TButton;
Button40: TButton;
Button41: TButton;
Button42: TButton;
dxDBGrid2: TdxDBGrid;
dxDBGrid3: TdxDBGrid;
dxDBGrid4: TdxDBGrid;
dxDBGrid5: TdxDBGrid;
dxDBGrid6: TdxDBGrid;
dxDBGrid7: TdxDBGrid;
ADQry_intensity: TADOQuery;
DS_intensity: TDataSource;
ADOConnection1: TADOConnection;
ADQry_equipment: TADOQuery;
DS_equipment: TDataSource;
dxDBGrid1week: TdxDBGridColumn;
dxDBGrid1date: TdxDBGridDateColumn;
dxDBGrid1time: TdxDBGridColumn;
dxDBGrid1Expr1003: TdxDBGridColumn;
dxDBGrid1intensity: TdxDBGridColumn;
dxDBGrid2week: TdxDBGridColumn;
dxDBGrid2date: TdxDBGridDateColumn;
dxDBGrid2time: TdxDBGridColumn;
dxDBGrid2Expr1003: TdxDBGridColumn;
dxDBGrid2equipment: TdxDBGridColumn;
DS_stroke: TDataSource;
ADQry_stroke: TADOQuery;
dxDBGrid3week: TdxDBGridColumn;
dxDBGrid3date: TdxDBGridDateColumn;
dxDBGrid3time: TdxDBGridColumn;
dxDBGrid3Expr1003: TdxDBGridColumn;
dxDBGrid3stroke: TdxDBGridColumn;
ADQry_time: TADOQuery;
DS_timeload: TDataSource;
dxDBGrid4week: TdxDBGridColumn;
dxDBGrid4date: TdxDBGridDateColumn;
dxDBGrid4time: TdxDBGridColumn;
dxDBGrid4Expr1003: TdxDBGridColumn;
dxDBGrid4timeload: TdxDBGridColumn;
DS_swimpool: TDataSource;
ADQry_swimpool: TADOQuery;
dxDBGrid5week: TdxDBGridColumn;
dxDBGrid5date: TdxDBGridDateColumn;
dxDBGrid5time: TdxDBGridColumn;
dxDBGrid5Expr1003: TdxDBGridColumn;
dxDBGrid5swimpool: TdxDBGridColumn;
ADQry_date: TADOQuery;
DS_date: TDataSource;
dxDBGrid6week: TdxDBGridColumn;
dxDBGrid6date: TdxDBGridDateColumn;
dxDBGrid6time: TdxDBGridColumn;
dxDBGrid6Expr1003: TdxDBGridColumn;
DS_mode: TDataSource;
ADQry_mode: TADOQuery;
dxDBGrid7week: TdxDBGridColumn;
dxDBGrid7date: TdxDBGridDateColumn;
dxDBGrid7time: TdxDBGridColumn;
dxDBGrid7Expr1003: TdxDBGridColumn;
dxDBGrid7mode: TdxDBGridColumn;
procedure Btn_in_sClick(Sender: TObject);
procedure Btn_in_rClick(Sender: TObject);
procedure Btn_e_sClick(Sender: TObject);
procedure Btn_e_rClick(Sender: TObject);
procedure Btn_s_sClick(Sender: TObject);
procedure Btn_s_rClick(Sender: TObject);
procedure Btn_t_sClick(Sender: TObject);
procedure Btn_t_rClick(Sender: TObject);
procedure Btn_p_sClick(Sender: TObject);
procedure Btn_p_rClick(Sender: TObject);
procedure Btn_d_sClick(Sender: TObject);
procedure Btn_d_rClick(Sender: TObject);
procedure Btn_m_sClick(Sender: TObject);
procedure Btn_m_rClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Frm_sta: TFrm_sta;
implementation
{$R *.dfm}
procedure TFrm_sta.Btn_in_sClick(Sender: TObject);
begin
ADQry_intensity.Active:=True;
Frm_sta.Btn_in_s.Enabled:=False;
end;
procedure TFrm_sta.Btn_in_rClick(Sender: TObject);
begin
ADQry_intensity.Active:=False;
Frm_sta.Btn_in_s.Enabled:=True;
end;
procedure TFrm_sta.Btn_e_sClick(Sender: TObject);
begin
ADQry_equipment.Active:=True;
Btn_e_s.Enabled:=False;
end;
procedure TFrm_sta.Btn_e_rClick(Sender: TObject);
begin
ADQry_equipment.Active:=False;
Btn_e_s.Enabled:=True;
end;
procedure TFrm_sta.Btn_s_sClick(Sender: TObject);
begin
ADQry_stroke.Active:=True;
Btn_s_s.Enabled:=False;
end;
procedure TFrm_sta.Btn_s_rClick(Sender: TObject);
begin
ADQry_stroke.Active:=False;
Btn_s_s.Enabled:=False;
end;
procedure TFrm_sta.Btn_t_sClick(Sender: TObject);
begin
ADQry_time.Active:=True;
Btn_t_s.Enabled:=False;
end;
procedure TFrm_sta.Btn_t_rClick(Sender: TObject);
begin
ADQry_time.Active:=False;
Btn_t_s.Enabled:=True;
end;
procedure TFrm_sta.Btn_p_sClick(Sender: TObject);
begin
ADQry_swimpool.Active:=True;
Btn_p_s.Enabled:=False;
end;
procedure TFrm_sta.Btn_p_rClick(Sender: TObject);
begin
ADQry_swimpool.Active:=False;
Btn_p_s.Enabled:=True;
end;
procedure TFrm_sta.Btn_d_sClick(Sender: TObject);
begin
ADQry_date.Active:=True;
Btn_d_s.Enabled:=False;
end;
procedure TFrm_sta.Btn_d_rClick(Sender: TObject);
begin
ADQry_date.Active:=False;
Btn_d_s.Enabled:=True;
end;
procedure TFrm_sta.Btn_m_sClick(Sender: TObject);
begin
ADQry_mode.Active:=True;
Btn_m_s.Enabled:=False;
end;
procedure TFrm_sta.Btn_m_rClick(Sender: TObject);
begin
ADQry_mode.Active:=False;
Btn_m_s.Enabled:=True;
end;
end.
program STAS;
uses
Forms,
main in 'main.pas' {Frm_main},
Splashform in 'Splashform.pas' {Splash},
sta in 'sta.pas' {Frm_sta};
{$R *.res}
begin
Application.Initialize;
Splash:=TSplash.Create(Application);
Splash.Show;
Splash.Update;
Application.Title := '简易统计系统';
Application.CreateForm(TFrm_main, Frm_main);
Application.CreateForm(TFrm_sta, Frm_sta);
Splash.Hide;
Splash.Free;
Application.Run;
end.