URL: http://edn.embarcadero.com/article/27568
Abstract: Delphi 6 introduces support for COM+ object pooling, which can provide significant performance improvements under some circumstances. We take a look at Delphi 6s object pooling support. By Vincent Parrett.
Typically, when a client application instantiates a COM+ object, the COM+ runtime will create a new instance of the object. When your client is done with the object, COM+ will destroy the object. This all makes for very efficient use of memory resources, and under normal loads provides quite an acceptable performance.
However, under higher loads the creation and destruction of objects can become a substantial overhead. This is especially true if your COM+ objects are themselves allocating resources, instantiating other objects, and so on.
Object pooling can help in these situations by reducing the number of times an object must be instantiated or destroyed. When pooling is in effect, a client's request for an object w ......
Delphi formatµÄÓ÷¨
Ò»¡¢Formatº¯ÊýµÄÓ÷¨
FormatÊÇÒ»¸öºÜ³£Óã¬È´ÓÖËƺõºÜ·³µÄ·½·¨£¬±¾ÈËÊÔͼ¶ÔÕâ¸ö·½·¨µÄ°ïÖú½øÐÐһЩ·Ò룬ÈÃËüÓÐÒ»¸öÍêÕûµÄ¸Åò£¬ÒÔ¹©´ó¼Ò²éѯ֮Óãº
Ê×ÏÈ¿´ËüµÄÉùÃ÷£º
function Format(const Format: string; const Args: array of const): string; overload;
ÊÂʵÉÏFormat·½·¨ÓÐÁ½¸öÖÖÐÎʽ£¬ÁíÍâÒ»ÖÖÊÇÈý¸ö²ÎÊýµÄ£¬Ö÷ÒªÇø±ðÔÚÓÚËüÊÇḬ̈߳²È«µÄ£¬µ«²¢²»¶àÓã¬ËùÒÔÕâÀïÖ»¶ÔµÚÒ»¸ö½éÉÜ£º
function Format(const Format: string; const Args: array of const): string; overload;
Format²ÎÊýÊÇÒ»¸ö¸ñʽ×Ö·û´®£¬ÓÃÓÚ¸ñʽ»¯ArgsÀïÃæµÄÖµµÄ¡£ArgsÓÖÊÇʲôÄØ£¬ËüÊÇÒ»¸ö±äÌåÊý×飬¼´ËüÀïÃæ¿ÉÒÔÓжà¸ö²ÎÊý£¬¶øÇÒÿ¸ö²ÎÊý¿ÉÒÔ²»Í¬¡£
ÈçÒÔÏÂÀý×Ó£º
Format('my name is %6s',['wind']);
·µ»Øºó¾ÍÊÇ
my name is wind
ÏÖÔÚÀ´¿´Format²ÎÊýµÄÏêϸÇé¿ö£º
FormatÀïÃæ¿ÉÒÔдÆÕͨµÄ×Ö·û´®£¬±ÈÈç'my name is' µ«ÓÐЩ¸ñʽָÁî×Ö·û¾ßÓÐÌØÊâÒâÒ壬±ÈÈç"%6s"
¸ñʽָÁî¾ßÓÐÒÔϵÄÐÎʽ£º
"%" [index ":"] ["-"] [width] ["." prec] type
ËüÊÇÒÔ"%"¿ªÊ¼,¶øÒÔtype½áÊø£¬type±íʾһ¸ö¾ßÌåµÄÀàÐÍ¡£ÖмäÊÇÓÃÀ´¸ñʽ»¯typeÀàÐ͵ÄÖ¸Áî×Ö·û£¬ÊÇ¿ÉÑ¡µÄ¡£
ÏÈÀ´¿´¿´type,type ......
unit Servicescontrol;
interface
uses Windows,Messages,SysUtils,Winsvc,Dialogs;
function StartServices(Const SvrName:String):Boolean;
function StopServices(Const SvrName:String):Boolean;
function QueryServiceStatu(Const SvrName: String):String;
function CreateServices(Const SvrName,FilePath:String):Boolean;
function DeleteServices(Const SvrName: String):Boolean;
implementation
//¿ªÆô·þÎñ
function StartServices(Const SvrName: String): Boolean;
var
a,b:SC_HANDLE;
c:PChar;
begin
Result:=False;
a:=OpenSCManager(nil,nil,SC_MANAGER_ALL ......
Ë˵DelphiûÓйþÏ££¿££DelphiÖУ¬TStringListºÍTHashedStringListµÄÐÔÄܶԱÈ
Ôø¾¿´µ½ºÜ¶àÈËÔÚÈÂÈÂDelphiûÓйþÏ£±í£¬ÕâЩÈ˵Ķ¯ÊÖÒâʶ¹ÃÇÒ²»ÂÛ£¬È´»¹ÓкܶàÈËÒÔ´ËÀ´Ö¤Ã÷Delphi±È±ðµÄÓïÑÔÀ¬»ø£¬ÊµÔÚÊÇ...
ºÃ£¬ÀÎɧ´òס£¬×ª½ÓÕýÌâ¡£
TStringListÊÇÎÒÃdz£ÓõÄ×Ö·û´®ÁбíÀàÐÍ£¬Ó÷¨¾Í²»ÔÚÕâÀï׸Êö£¬µ«ÊÇ£¬ÔÚÊý¾ÝÆäÏîÊýÔö¶àʱ£¬ÆäËÑË÷£¨Ö÷ÒªÊÇname/keyËÑË÷ºÍindexofËÑË÷£©ÐÔÄܻἱ¾çϽµ£¬ÔÒòÊÇTStringListµÄÄÚ²¿´æ´¢Ê¹ÓÃÁËÁ´±íÐÎʽ£¬¶øËÑË÷²Ù×÷ʹÓÃÁËÑ»·±éÀú·½Ê½¡£
ÖµµÃ¸ßÐ˵ÄÊÇ£¬ÔÚiniFilesµ¥Ôª£¬DelphiΪÎÒÃÇÌṩÁËTHashedStringListÀàÐÍ£¬¼´£¬¾¹ý¹þÏ£´¦ÀíµÄTStringList£¬Ëü¼Ì³Ð×ÔTStringList£¬Ö»ÊǶÔËÑË÷·½·¨½øÐÐÁËÓÅ»¯£¬Òò´Ë£¬ÎÒÃÇÍêÈ«¿ÉÒÔ·ÅÐĵÄÔÚ´óÁ¿×Ö·û´®ËÑË÷µÄʱºòʹÓÃËüÀ´´úÌæTStringList£¬¶øÐèÒª¸Ä±äµÄÖ»ÊÇÔÚ:=µÄºóÃæÓÃTHashedStringList.createÀ´´úÌæTStringList.create£¬µ«ÆäËÙ¶ÈÈ´Ìá¸ßÁËÒ»¸öÊýÁ¿¼¶¡£
ΪÁËÏÔʾÁ½Õß¼äÐÔÄܵIJî¾à£¬ÎÒдÁ˼¸¸ö¼òµ¥µÄÓï¾äÀ´²âÊÔËûÃǸ÷×ÔµÄÌØÐÔ¡£
unit ufrmMainForm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
......
The built-in assembler allows you to write assembly code within Delphi programs. It has the following features:
ÄÚǶµÄ»ã±àÆ÷ÔÊÐíÔÚdelphi³ÌÐòÖÐÊéд»ã±à´úÂ룬ËûÓÐÈçÏÂÌØÐÔ£º
Allows for inline assembly
ÔÊÐíÄÚǶ»ã±à
Supports all instructions found in the Intel Pentium III, Intel MMX extensions, Streaming SIMD
Extensions (SSE), and the AMD Athlon (including 3D Now!)
Ö§³ÖËùÓÐÖ¸ÁÈçÓ¢Ìضû±¼Èý´¦ÀíÆ÷£¬Ó¢ÌضûMMXÀ©Õ¹£¬Streaming SIMDÀ©Õ¹£¨SSE£©£¬ÒÔ¼°AMD Athlon´¦ÀíÆ÷£¨°üÀ¨3D£©
Provides no macro support, but allows for pure assembly function procedures
²»ÌṩºêÖ§³Ö£¬µ«ÔÊÐí´¿»ã±àº¯Êý¹ý³Ì
Permits the use of Delphi identifiers, such as constants, types, and variables in assembly statements
ÔÊÐíʹÓÃdelphi±êʶ·û£¬ÖîÈçÔÚ»ã±à¶ÎÄڵij£Á¿£¬ÀàÐͺͱäÁ¿
As an alternative to the built-in assembler, you can link to object files that contain external procedures and functions. See External declarations for more information.
µ±Ìæ´úÄÚÖû ......
×î½üÒª×öÒ»¸öͼÊé¹ÜÀíϵͳ£¬²¢ÇÒÊÇÓÃDelphiÈí¼þ¿ª·¢£¬ºÜ¶à¶¼²»¶®£¬±¾À´ÊÇ¿ÉÒÔ´ÓÍøÉÏÏÂÔØ£¬Ñ§Ï°Ò»Ïµģ¬¿ÉÊDz»ÖªµÀÔõôÆƽâµÇ½ÃÜÂ룬ÔËÐÐʱû°ì·¨µÇ½½øÈ¥£¬5555~~ºÃºÃѧϰ£¬ÓиßÊÖÖ¸µã¾ÍºÃÁË…… ......