建议使用delphi的线程类
//////
type TCpa=RECORD
Cb_p,Cb_n:TComboBox;
end;
//////
function Faddress(var cpa:TCpa):dword;stdcall;
begin
try
address.Filter:='';
address.Filtered:=false;
address.First;
if cpa.cb_p=cpa.cb_n then begin
cpa.Cb_p.Items.Clear;
while not address.Eof do begin
cpa.cb_p.Items.Add(address.FieldByname('c'+copy(cpa.Cb_p.Name,2,length(cpa.Cb_p.Name))).AsString);
address.Next;
end;
end
else begin
cpa.cb_n.Items.Clear;
address.Filter:='c'+copy(cpa.Cb_p.Name,2,length(cpa.Cb_p.Name))+'='''+cpa.Cb_p.Text+'''';
address.Filtered:=true;
while not address.Eof do begin
cpa.cb_n.Items.Add(address.FieldByname('c'+copy(cpa.Cb_n.Name,2,length(cpa.Cb_n.Name))).AsString);
address.Next;
end;
end;
except
end;
result:=0;
end;