Delphi±àдϵͳ·þÎñ¶þ£ºÏµÍ³·þÎñºÍ×ÀÃæ³ÌÐòµÄÇø±ð
Delphi±àдϵͳ·þÎñ¶þ£ºÏµÍ³·þÎñºÍ×ÀÃæ³ÌÐòµÄÇø±ð ÊÕ²Ø
Windows 2000/XP/2003µÈÖ§³ÖÒ»ÖÖ½Ð×ö“ϵͳ·þÎñ³ÌÐò”µÄ½ø³Ì£¬ÏµÍ³·þÎñºÍ×ÀÃæ³ÌÐòµÄÇø±ðÊÇ£º
ϵͳ·þÎñ²»Óõǽϵͳ¼´¿ÉÔËÐУ»
ϵͳ·þÎñÊÇÔËÐÐÔÚSystem Idle Process/System/smss/winlogon/servicesϵģ¬¶ø×ÀÃæ³ÌÐòÊÇÔËÐÐÔÚExplorerϵģ»
ϵͳ·þÎñÓµÓиü¸ßµÄȨÏÞ£¬ÏµÍ³·þÎñÓµÓÐSytemµÄȨÏÞ£¬¶ø×ÀÃæ³ÌÐòÖ»ÓÐAdministratorȨÏÞ£»
ÔÚDelphiÖÐϵͳ·þÎñÊǶÔ×ÀÃæ³ÌÐò½øÐÐÁËÔÙÒ»´ÎµÄ·â×°£¬¼Èϵͳ·þÎñ¼Ì³ÐÓÚ×ÀÃæ³ÌÐò¡£Òò¶øÓµÓÐ×ÀÃæ³ÌÐòËùÓµÓеÄÌØÐÔ£»
ϵͳ·þÎñ¶Ô×ÀÃæ³ÌÐòµÄDoHandleException×öÁ˸Ľø£¬»á×Ô¶¯°ÑÒì³£ÐÅϢдµ½NT·þÎñÈÕÖ¾ÖУ»
ÆÕͨӦÓóÌÐòÆô¶¯Ö»ÓÐÒ»¸öỊ̈߳¬¶ø·þÎñÆô¶¯ÖÁÉÙº¬ÓÐÈý¸öÏ̡߳££¨·þÎñº¬ÓÐÈý¸öỊ̈߳ºTServiceStartThread·þÎñÆô¶¯Ị̈߳»TServiceThread·þÎñÔËÐÐỊ̈߳»ApplicationÖ÷Ị̈߳¬¸ºÔðÏûϢѻ·£©£»
ժ¼´úÂ룺
procedure TServiceApplication.Run;
begin
.
.
.
StartThread := TServiceStartThread.Create(ServiceStartTable);
try
while not Forms.Application.Terminated do
Forms.Application.HandleMessage;
Forms.Application.Terminate;
if StartThread.ReturnValue <> 0 then
FEventLogger.LogMessage(SysErrorMessage(StartThread.ReturnValue));
finally
StartThread.Free;
end;
.
.
.
end;
procedure TService.DoStart;
begin
try
Status := csStartPending;
try
FServiceThread := TServiceThread.Create(Self);
 
Ïà¹ØÎĵµ£º
¸Õ¿ªÊ¼ºÜ²»Ï°¹ßc#µÄ·ç¸ñ£¬°¥£¬ÏÈÈëΪÖ÷°¡£¬delphiÏ°¹ßÁË£¬{}´úÌæbegin/endÌ«ÔúÑÛ¡£
ÊôÐÔ·½·¨µÄÐû¸æºÍ´úÂëÔÚÒ»Æð£¬Ã»ÓÐÏñdelphi·Öinterface/implementation£¬¸Ð¾õÌ«ÂÒ£¬¶¼²»ÖªµÀÒ»¸öclassµ½µ×Óм¸¸ö·½·¨¡£
ÿ¸öÊôÐԺͷ½·¨Ç°Ã涼Ҫµ¥¶Àдprivate/protected/public£¬ÀÏÌ죬c#ÊÇdelphiÖ®¸¸Éè¼ÆµÄÞÞ£¬Ôõô²»Ñ§delphiдһ¸ö¾ÍÐÐ ......
×î½üÐèÒª°²×°µÚÈý·½×é¼þ£¬ÔÚÍøÂçÉÏÕÒµ½Ò»Ð©×ÊÁÏת¹ýÀ´¿´¿´
ÓÉÓÚ×é¼þÌṩµÄ·½Ê½²»Í¬£¬ËùÒÔ°²×°µÄ·½·¨Ò²ÊDz»Ò»ÑùµÄ£¬ÏÂÃæ¾ÍÄ¿Ç°³£¼ûµÄ¸÷ÖÖÐÎʽµÄ×é¼þµÄ°²×°·½·¨½éÉÜһϡ£
1 Ö»ÓÐÒ»¸öDCUÎļþµÄ×é¼þ¡£DCUÎļþÊDZàÒëºÃµÄµ¥ÔªÎļþ£¬ÕâÑùµÄ×é¼þÊÇ×÷Õß²»Ïë°ÑÔ´Â빫² ......
1¡¢±£Ö¤Äã´«µÝµÄ²ÎÊýÒªÕýÈ·£ºC++ÖеÄchar *¶ÔÓ¦PASCALÖеÄpchar¡£
2£ºC++Öе¼³öµÄº¯ÊýµÄ²ÎÊýµ÷Ó÷½Ê½ÒªºÍÄãDELPHIÖеĵ¼ÈëµÄº¯Êý²ÎÊýµ÷Ó÷½Ê½ÒªÒ»ÖÂ!
ÀýÈ磺 C++µÄ²ÎÊýµ÷Ó÷½Ê½ ¶ÔÓ¦µÄDELPHIµÄ²ÎÊýµ÷Ó÷½Ê½
_declspec ......
var
L,i:integer;
Ustr,str:string;
p:char;
begin
str:='123456789ABCDEFG'
L:=length(str);
for i:=1 to l do begin
p:=str[i];
str[i]:=str[l-(i-1)];
......
Delphi±àдϵͳ·þÎñÁù£ºÔÚ·þÎñÖÐʹÓÃCOM×é¼þ ÊÕ²Ø
ÔÚ·þÎñÖе÷ÓÃCOM×é¼þ²»ÄÜÏñÔÚ×ÀÃæ³ÌÐòÖÐÖ±½Ó´´½¨£¬ÔÚÿ´Î´´½¨Ö®Ç°Ïȵ÷ÓÃCoInitialize(nil)£¬ÊͷŵÄʱºòµ÷ÓÃCoUninitialize¡£ÀýÈ磺µ÷ÓÃADO×é¼þ
var
Qry: TADOQuery;
begin
CoInitialize(nil);
Qry := TADOQuery.Create(nil);
tr ......