Delphi Thread
Ö÷´°Ìå:
Delphi(Pascal) code:
procedure TfrmMain.btnResumeClick(Sender: TObject);
begin
myThread := TClientThread.Create(LeftPart(cbbServer.Text, ':'), StrToInt(RightPart(cbbServer.Text, ':')));
myThread.Resume;
mmoLog.Lines.Add('Ïß³ÌÒѼ¤»î');
end;
procedure TfrmMain.btnSuspendClick(Sender: TObject);
begin
if myThread = nil then
begin
ShowMessage('Ïß³Ìδ´´½¨!');
Exit;
end;
myThread.Suspend;
mmoLog.Lines.Add('Ïß³ÌÒѹÒÆð');
end;
procedure TfrmMain.btnStopClick(Sender: TObject);
begin
if myThread = nil then
begin
ShowMessage('Ïß³Ìδ´´½¨!');
Exit;
end;
myThread.Terminate;
myThread.WaitFor;
mmoLog.Lines.Add('Ïß³ÌÒÑÍ£Ö¹');
end;
Ï̵߳¥Ôª:
Delphi(Pascal) code:
unit uClientThread;
interface
uses
Windows, Classes, SysUtils, IdTCPClient, uString, Main, uCommon, Messages, Dialogs;
const
CM_DIAL = WM_USER + $100;
CM_HUNGUP = WM_USER + $101;
type
TClientThread = class(TThread)
private
FClient: TIdTCPClient;
FRequest: TStrings;
FResponse: TStrings;
FNotifyHandle: HWND;
// FPioneerCtrl: HWND;
procedure DoDial;
procedure DoDrop;
procedure DoUpload;
procedure DoSave;
protected
procedur
Ïà¹ØÎÊ´ð£º
¾ÍÊÇÒ»¸ö·þÎñ¶ËºÍÒ»¸ö¿Í»§¶Ë£¬Àï±ßÓÐһЩ¹²Óõ¥Ôª £¬ÎÒÔÚ ¹¤³ÌµÄSEARCH PATHÀïÉèÖõÄ·¾¶£¬
Àï±ßÓиö½á¹¹Ì壬ÎÒÔÚ·þÎñ¶Ë´ò¿ª£¬¼ÓÁ˳ÉÔ±£¬µ«ÊÇÎÒÔÚ¿Í»§¶ËÆäËûµ¥Ôª·ÃÎʲ»µ½ÎÒмӵģ¬ÎÒÔÚ¿Í»§¶Ë´ò¿ªÄǸöµ¥Ôª£¬È·Êµ¼ÓÁ ......
Ò»°ã¶¼ÊÇÔõô½Ó»îµÄ£¿
ÊÕÈëÔõôÑù
sohu£¿soho£¿
sohu ¿ÉÄÜÊÇsmall office house unit
С°ì¹«ÊÒ£¬°Ñ¼Ò±ä³Éµ¥Î»¡£
È¥Íþ¿ÍÍø°¡,ºÜ¶à¸öÄØ,»¹ÓÐÍâ°üµÄÍøÕ¾
ѧϰѧϰ¡£
ÏÖÔÚDelphi×ö¶«Î÷²»ÐÐÁË,´¦ÓÚÌÔÌ×´ ......
Ò»Ö±ÏëʹÓÃdll£¬µ«delphiµÄdll×Ó´°Ìå¾³£Óи÷ÖÖÎÊÌ⣬±ÈÈçÖ÷´°¿ÚÓëdll×Ó´°¿ÚµÄ½¹µãÎÊÌ⣬×Ó´°¿ÚÖпؼþµÄtab¼ü¡¢Èȼü¡¢enter¼üµÈµÄÎÊÌ⣬×Ó´°¿ÚÍ˳öµÄÎÊÌ⡢ƽÃæ°´Å¥ÎÊÌâµÈµÈ£¬ÍøÕ¾ÉϽøÐÐÁËËÑË÷£¬Ã»ÓбȽÏÍêÃÀµÄ½â¾ö· ......
1¡¢ÎÒÄÜ·ñÔÚdelphiÀïµ÷ÓÃÁíÍâÒ»¸öºǫ́³ÌÐò£¬µ«ÊÇÎÒ²»ÐèÒªµÈ´ýÕâ¸öºǫ́³ÌÐòÖ´ÐÐÍê³É£¬»¹¿ÉÒÔ¼ÌÐøÖ´ÐбðµÄ³ÌÐò¡£ÇëÎʾßÌåÔõôÑù²ÅÄÜʵÏÖ¡£
2¡¢ÎÒÄÜ·ñÔÚdelphiÉÏÖ´ÐÐÒ»¸ö¿ì½Ý¼ü£¬Ê¹delphi´°¿Ú³ÌÐòÄܹ»Ë¢ÐÂһϡ£[/size ......
µ÷ÓÃdelphiдµÄÒ»¸öcom×é¼þ£¬·½·¨ÊÇ
procedure test(out Param1: Integer); safecall;
×¢²ácomÖ®ºóÔÚc#ÖÐÒýÓö¼Ã»ÓÐÎÊÌâ
............´´½¨²¿·Ö¾ÍÊ¡ÂÔ²»Ð´ÁË
............
int v_int;
test(out v_int); µ÷ÓÃte ......