L
leijh001
Unregistered / Unconfirmed
GUEST, unregistred user!
constructor transthread.Create(Mm1: TMemo;
Num_: integer;
StoredP: TADOStoredProc;
FSTRING: string;
usetime: Int64;
con_: TADOConnection);
begin
InitializeCriticalSection(cs);
CoInitialize(nil);
TmpNum := Num_;
TmpM1 := Mm1;
if FSTRING <> '' then
Strfram := FSTRING else
setframes(TmpM1);
FStoredP := StoredP;
FStoredP.Close;
FStoredP.ProcedureName := 'analyseframe;1';
FStoredP.Connection := con_;
FStoredP.Parameters.Clear;
FStoredP.Parameters.CreateParameter('@receiveframe', ftString, pdInput, 8000, fgUnassigned);
FStoredP.Parameters.CreateParameter('@returnframe', ftString, pdOutput, 6000, fgUnassigned);
FStoredP.Parameters[0].Value := Strfram;
FStoredP.Parameters[1].Value := '';
fusetime := usetime;
FreeOnTerminate := true;
// Have thread object free itself when terminated
inherited Create(false);
// Create thread in a suspendend state
end;
procedure transthread.Execute;
begin
try
FStoredP.Prepared;
FStoredP.ExecProc;
EnterCriticalSection(cs);
begin
Synchronize(retDataMemo);
// 同步
Synchronize(returnprovalue);
end;
LeaveCriticalSection(cs);
CoUninitialize;
except
CoUninitialize;
FQueryException := ExceptObject as Exception;
Synchronize(ShowQryError);
LeaveCriticalSection(cs);
end;
{ Place thread code here }
end;
Num_: integer;
StoredP: TADOStoredProc;
FSTRING: string;
usetime: Int64;
con_: TADOConnection);
begin
InitializeCriticalSection(cs);
CoInitialize(nil);
TmpNum := Num_;
TmpM1 := Mm1;
if FSTRING <> '' then
Strfram := FSTRING else
setframes(TmpM1);
FStoredP := StoredP;
FStoredP.Close;
FStoredP.ProcedureName := 'analyseframe;1';
FStoredP.Connection := con_;
FStoredP.Parameters.Clear;
FStoredP.Parameters.CreateParameter('@receiveframe', ftString, pdInput, 8000, fgUnassigned);
FStoredP.Parameters.CreateParameter('@returnframe', ftString, pdOutput, 6000, fgUnassigned);
FStoredP.Parameters[0].Value := Strfram;
FStoredP.Parameters[1].Value := '';
fusetime := usetime;
FreeOnTerminate := true;
// Have thread object free itself when terminated
inherited Create(false);
// Create thread in a suspendend state
end;
procedure transthread.Execute;
begin
try
FStoredP.Prepared;
FStoredP.ExecProc;
EnterCriticalSection(cs);
begin
Synchronize(retDataMemo);
// 同步
Synchronize(returnprovalue);
end;
LeaveCriticalSection(cs);
CoUninitialize;
except
CoUninitialize;
FQueryException := ExceptObject as Exception;
Synchronize(ShowQryError);
LeaveCriticalSection(cs);
end;
{ Place thread code here }
end;