| 发表于:2008-01-09 11:00:24 楼主 |
我在主程序中动态调用dll。为何在dll中创建窗体后立刻进入窗体的onshow过程中呢?代码如下: 主程序: showform(self.handle, self.cxpb_downfile, pchar('a'),pchar(loginusername),pchar(loginuserpwd),pchar('a'),nil,nil,loginuserjb,currentkc,webclass); 其中self.cxpb_downfile是一个进度条控件,webclass是自定义的一个类实例 dll文件: procedure showform(ahandle: thandle;cxpb_downfile:tcxprogressbar;dllfilename, username, password,usergroupname, extendparam1, extendparam2: pchar;userjb:integer;currentkc:string;webclass:twebclass); stdcall; begin application.handle := ahandle; frm_bm := tfrm_bm.create(nil);//程序执行到此后,直接调用 tfrm_bm.formshow,未执行下列5行代码 frm_bm.cxpb_downfile:=cxpb_downfile; frm_bm.loginusername:=username; frm_bm.loginuserpwd:=password; frm_bm.loginuserjb:=userjb; frm_bm.webclass:=webclass; frm_bm.currentkc:=currentkc; frm_bm.showmodal; frm_bm.free; end; procedure tfrm_bm.formshow(sender: tobject); var i:integer; bmnums:integer; servermd5:string; begin gettableinfoxx('gettable_jbyy_info','table_jbyy'); gettableinfoxx('gettable_xb_info','table_xb'); gettableinfoxx('gettable_mz_info','table_mz'); gettableinfoxx('gettable_zy_info','table_zy'); gettableinfoxx('gettable_whcd_info','table_whcd'); gettableinfoxx('gettable_blcjzl_info','table_blcjzl'); gettableinfoxx('gettable_cjpxzl_info','table_cjpxzl'); bmnums:=getbmnum; filldataset; if ( bmnums <> self.stu_set.recordcount) then begin getbmxx('0') ; filldataset; end; end; |
|
|
|
|