¤£¤£ ´õ¸¹ÀÌ ÇØÁÖ¼¼¿ä.¤¾¤¾
´©°¡ ASyncCalls ¶óÀ̺귯¸®µµ ¹ø¿ªÇØ줫À¸¸é ÁÁ°Ú³×¿ä..¤¾¤¾(Á¦°¡ ÇÏ°í ½ÍÁö¸¸ ¿µ¾î°¡ µþ·Á¼)
http://andy.jgknet.de/blog/bugfix-units/asynccalls-29-asynchronous-function-calls/
¾Æ·¡Ã³·³ »ç¿ëÇÏ´Â »ùÇÃÀÌ ÀÖ½À´Ï´Ù...
procedure TForm1.Button3Click(Sender: TObject);
var
Value: Integer;
begin
TAsyncCalls.Invoke(procedure
begin
Value := 10;
TAsyncCalls.VCLInvoke(procedure
begin
ShowMessage(`The value may not equal 10: ` + IntToStr(Value));
end);
Value := 20;
TAsyncCalls.VCLSync(procedure
begin
ShowMessage(`The value equals 20: ` + IntToStr(Value));
end);
Value := 30;
end);
Sleep(1000);
end;
procedure MainProc(const S: string);
var
Value: Integer;
a: IAsyncCall;
function DoSomething: Integer;
begin
if S = `Abc` then
Value := 1;
Result := 0;
end;
begin
a := LocalAsyncCall(@DoSomething);
// do something
a.Sync;
LocalAsyncExec(@DoSomething, Application.ProcessMessages);
end;
2012-02-21 ¿ÀÈÄ 8:33:45