Delphi XE6測試 |
缺席
|
jimmywu
一般會員 發表:41 回覆:37 積分:15 註冊:2006-12-12 發送簡訊給我 |
Dear Sir:
測試XE6時, 在測試 User/Password畫面,若輸入正確User/Password,則啟動FrmmainMenu(MDI Form), 結果輸入正確User/Password後,按 Button鍵時,要連按2次才可啟動FrmMainMenu(第一次畫面無任何反應), By F8 STEP Debug ,發現每次按Button鍵時,都會跑到System.CLASS停住,在如下單元: {SELSEIF Defined(CPUX64)} {In R11=Address of method pointer} {Out RAX=Result} var Msg:TMessage; asm .PARAMS 2 MOV Msg.Msg,Message MOV Msg.WParam,WParam MOV Msg.LParam,WParam MOV Msg.Result,0 LEA RDX,Msg MOV RCX,[R11].TMethod.Data CALL [R11].TMethod.Code MOV RAX,Msg,Result end; {SENDIF CPUX64} |
jimmywu
一般會員 發表:41 回覆:37 積分:15 註冊:2006-12-12 發送簡訊給我 |
|
jimmywu
一般會員 發表:41 回覆:37 積分:15 註冊:2006-12-12 發送簡訊給我 |
|
P.D.
版主 發表:603 回覆:4038 積分:3874 註冊:2006-10-31 發送簡訊給我 |
|
jimmywu
一般會員 發表:41 回覆:37 積分:15 註冊:2006-12-12 發送簡訊給我 |
Dear P.D.:
請查看標註 :<=======這一行 ,的程式欄,我覺得是訊息傳遞層級不同造成! ===> Project SRC: program Project1; uses Forms, Controls, Windows, PASSDLGU in 'PASSDLGU.pas' {PASSDLGF}, MDIFORMU in 'MDIFORMU.pas' {MDIFORMF}; {$R *.res} var tmplog :tpassdlgf; Begin Application.Initialize; tmplog :=tpassdlgf.Create(application); if assigned(tmplog) then begin tmplog.ShowModal; if tmplog.ModalResult= mrOK then <=======這一行 begin tmplog.Free; Application.CreateForm(TMDIFORMF, MDIFORMF); Application.Run; end; end else tmplog.Free; end. ====>MDIFORM的Src: unit MDIFORMU; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Menus; type TMDIFORMF = class(TForm) MainMenu1: TMainMenu; N11: TMenuItem; N21: TMenuItem; N31: TMenuItem; N1: TMenuItem; procedure N11Click(Sender: TObject); procedure N21Click(Sender: TObject); procedure N31Click(Sender: TObject); procedure N1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var MDIFORMF: TMDIFORMF; implementation {$R *.dfm} procedure TMDIFORMF.N11Click(Sender: TObject); begin Showmessage('Test 01'); end; procedure TMDIFORMF.N21Click(Sender: TObject); begin Showmessage('Test 02'); end; procedure TMDIFORMF.N31Click(Sender: TObject); begin Showmessage('Test 03'); end; procedure TMDIFORMF.N1Click(Sender: TObject); begin close; end; end. ===>按2次的 Form SRC: unit PASSDLGU; interface uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls, Buttons,Dialogs, Messages,DB, DBTables, ExtCtrls, jpeg,SHellapi; type TPASSDLGF = class(TForm) Label1: TLabel; Label2: TLabel; Label3: TLabel; EID: TEdit; EPASS: TEdit; CancelBtn: TButton; BTNOK: TButton; procedure CancelBtnClick(Sender: TObject); procedure BTNOKClick(Sender: TObject); private { Private declarations } public { Public declarations } end; var PASSDLGF: TPASSDLGF; implementation {$R *.dfm} procedure TPASSDLGF.CancelBtnClick(Sender: TObject); begin close; end; procedure TPASSDLGF.BTNOKClick(Sender: TObject); begin //ModalResult := mrCancel; if (eid.Text = 'ABC') and (epass.Text = '123' ) then begin BTNOK.ModalResult := mrOK; <=======這一行 end; if BTNOK.ModalResult <> mrOK then <=======這一行 begin showmessage('User or Password not correct !') ; eid.SetFocus; exit; end; end; end. ===>按1次的 Form SRC: unit PASSDLGU; interface uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls, Buttons,Dialogs, Messages,DB, DBTables, ExtCtrls, jpeg,SHellapi; type TPASSDLGF = class(TForm) Label1: TLabel; Label2: TLabel; Label3: TLabel; EID: TEdit; EPASS: TEdit; CancelBtn: TButton; BTNOK: TButton; procedure CancelBtnClick(Sender: TObject); procedure BTNOKClick(Sender: TObject); private { Private declarations } public { Public declarations } end; var PASSDLGF: TPASSDLGF; implementation {$R *.dfm} procedure TPASSDLGF.CancelBtnClick(Sender: TObject); begin close; end; procedure TPASSDLGF.BTNOKClick(Sender: TObject); begin //ModalResult := mrCancel; if (eid.Text = 'ABC') and (epass.Text = '123' ) then begin ModalResult := mrOK; <=======這一行 end; if ModalResult <> mrOK then <=======這一行 begin showmessage('User or Password not correct !') ; eid.SetFocus; exit; end; end; end. |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |