D
dev999
Unregistered / Unconfirmed
GUEST, unregistred user!
代码:
procedure TFrm_cj.reg_callback();
//回调函数
begin
cbinfo:=allocmem(sizeof(CBPROGRESSDesc));
Check(DbiRegisterCallBack(nil,cbGENPROGRESS,LongInt(0),sizeof(CBPROGRESSDesc),cbinfo,@TFrm_cj.batch_refresh));
end;
procedure TFrm_cj.unreg_callback();
begin
RegResult:=DbiRegisterCallBack(nil,cbGENPROGRESS,0,sizeof(CBPROGRESSDesc),nil,nil);
freemem(cbinfo);
end;
明明调用方式设置成cbGENPROGRESS,但debug时却返回cbGENERAL,why?
主程序如下(另外TFrm_cj.offline_get()是放在线程中执行的)
procedure TFrm_cj.offline_get();
BatchMove1:=TBatchMove.Create(self);
try
with BatchMove1do
begin
Source:=T_sour;
Destination:=T_des;
AbortOnKeyViol:=false;
AbortOnProblem:=false;
Transliterate:=true;
//Mode:=batAppendUpdate;
Mode:=batAppend;
//Mode:=batcopy ;
Mappings.Clear;
i:=0;
while i<=Length(field_array)-1do
begin
map_str:=field_array+'='+field_array[i+1];
Mappings.Add(map_str);
i:=i+2;
end;
reg_callback();
//回调函数
Execute;
unreg_callback()