unit t_receive_mail;
interface
uses
Classes, Messages, SysUtils, Variants,Graphics, Controls,Dialogs,
windows,u_fax_receive,u_main;
type
Treceive_mail = class(TThread)
private
{ Private declarations }
protected
procedure Execute;
override;
public
Constructor create(re_type:integer;re_str:string);
end;
implementation
{ Important: Methods and properties of objects in VCL or CLX can only be used
in a method called using Synchronize, for example,
Synchronize(UpdateCaption);
and UpdateCaption could look like,
procedure Treceive_mail.UpdateCaption;
begin
Form1.Caption := 'Updated in a thread';
end;
}
{ Treceive_mail }
constructor Treceive_mail.create(re_type:integer;re_str:string);
var
receive_mail:function (receive_type:integer;receive_str:string):boolean;stdcall;
Handle1: THandle;
begin
try
Handle1:=
LoadLibrary(pchar(ExtractFilePath(ParamStr(0))+'dll_receive_dll.dll'));
if Handle1<>0 then
begin
receive_mail:=GetProcAddress(Handle1,pchar('receive_mail'));
receive_mail(re_type,re_str);
freelibrary(Handle1);
end;
except
;
end;
if assigned(frm_fax_manage) and (frm_main.str_fax_lei.Text='收件箱') then
frm_fax_manage.t_fax_manage.Requery;
inherited create(false);
freeonterminate:=true;
end;
procedure Treceive_mail.Execute;
begin
{ Place thread code here }
end;
end.