DelphiÏÂPOS»ú¿ØÖÆÇ®Ïä,¿ÍÏÔ,´òÓ¡»ú,СƱ´òÓ¡
1¡¢¿ØÖÆPOS»úµÄ¿Í»§ÏÔʾÆÁ
procedure TFrmMain.ShowMoney(Money_Port: String;Money_String:String);
//Moneey_Port ¹ËÏÔ½Ó¿ÚCom1 or Com2 Money_String ¹ËÏÔÏÔʾµÄÄÚÈÝ
var
PrnFileName:TextFile;
begin
Assignfile(PrnFileName,Money_Port);
printer.Canvas.Font.Name:='ËÎÌå';
printer.Canvas.Font.Size:=8;
printer.Canvas.Font.Charset:=GB2312_CHARSET;
Rewrite(PrnFileName);
write(PRNFileName,chr(12)); //Çå³ý¹ËÏÔ
write(PRNFileName,chr(27)+chr(81)+chr(65)+Money_String+chR(13)); //ÏÔʾÐÅÏ¢
CloseFile(PRNFileName);
end;
2¡¢²»»»Ò³×ßÖ½µÄ´òÓ¡
procedure TFrmMain.AddPrintStrings(Strings: TStrings);
var
Prn: TextFile;
i: word;
begin
Assignfile(Prn,'lpt1');
printer.Canvas.Font.Name:='ËÎÌå';
printer.Canvas.Font.Size:=9;
printer.Canvas.Font.Charset:=GB2312_CHARSET;
try
Rewrite(Prn);
try
for i := 0 to Strings.Count - 1 do
writeln(Prn, Strings.Strings[i]);
finally
CloseFile(Prn);
end;
except
on EInOutError do
MessageBox(Handle,PChar('Îı¾´òÓ¡³ö´í!'),'¾¯¸æ',MB_ICONEXCLAMATION or MB_OK);
end;
end;
3¡¢×ßÖ½»»Ò³µÄ´òÓ¡
procedure TFrmMain.PrintStrings(Strings: TStrings);
var
Prn: TextFile;
i: word;
begin
AssignPrn(Prn);
try
Rewrite(Prn);
printer.Canvas.Font.Name:='ËÎÌå';
printer.Canvas.Font.Size:=9;
printer.Canvas.Font.Charset:=GB2312_CHARSET;
&nb
Ïà¹ØÎĵµ£º
DelphiµÄVCL¿ò¼ÜÔÚ´´½¨Ó¦ÓÃʱTApplicationÊÇÒ»¸ö×Ô¶¯´´½¨µÄÒþ²Ø´°¿Ú£¬ÆäËü´´½¨µÄ´°¿ÚÊÇ×Ô¶¯ÒԸô°¿ÚΪ´°¿Ú£¬Õâ¾Íµ¼Ö´´Ê¼µÄÖ÷´°¿ÚÔÚÈÎÎñÀ¸µÄϵͳ²Ëµ¥Ö»ÓÐÈýÏֻҪÔÚÖ÷´°¿ÚµÄCreateʼþÖн«ÏµÍ³²Ëµ¥ÓÃApplicationµÄϵͳ²Ëµ¥Ìæ»»£¬²¢½«SysCommandÏûϢת·¢µ½Ö÷´°¿Ú¾ÍÕý³£ÁË¡£
unit Unit1;
interface
uses
Windows ......
unit winntService;
interface
uses
Windows,WinSvc,WinSvcEx;
function InstallService(const strServiceName,strDisplayName,strDescription,strFilename: string):Boolean;
procedure UninstallService(strServiceName:string);
implementation
function StrLCopy(Dest: PChar; const Source: PChar; MaxLen: C ......
×î½üÐèÒª°²×°µÚÈý·½×é¼þ£¬ÔÚÍøÂçÉÏÕÒµ½Ò»Ð©×ÊÁÏת¹ýÀ´¿´¿´
ÓÉÓÚ×é¼þÌṩµÄ·½Ê½²»Í¬£¬ËùÒÔ°²×°µÄ·½·¨Ò²ÊDz»Ò»ÑùµÄ£¬ÏÂÃæ¾ÍĿǰ³£¼ûµÄ¸÷ÖÖÐÎʽµÄ×é¼þµÄ°²×°·½·¨½éÉÜһϡ£
1 Ö»ÓÐÒ»¸öDCUÎļþµÄ×é¼þ¡£DCUÎļþÊDZàÒëºÃµÄµ¥ÔªÎļþ£¬ÕâÑùµÄ×é¼þÊÇ×÷Õß²»Ïë°ÑÔ´Â빫² ......
1¡¢±£Ö¤Äã´«µÝµÄ²ÎÊýÒªÕýÈ·£ºC++ÖеÄchar *¶ÔÓ¦PASCALÖеÄpchar¡£
2£ºC++Öе¼³öµÄº¯ÊýµÄ²ÎÊýµ÷Ó÷½Ê½ÒªºÍÄãDELPHIÖеĵ¼ÈëµÄº¯Êý²ÎÊýµ÷Ó÷½Ê½ÒªÒ»ÖÂ!
ÀýÈ磺 C++µÄ²ÎÊýµ÷Ó÷½Ê½ ¶ÔÓ¦µÄDELPHIµÄ²ÎÊýµ÷Ó÷½Ê½
_declspec ......
ÒýÓòÎÊý£º
ÒýÓòÎÊýÓÃvar¹Ø¼ü×Ö±êʾ
procedure DoubleTheValue (var Value: Integer);
begin
Value := Value * 2;
end;
ÔÚÕâÖÖÇé¿öÏ£¬²ÎÊý¼È°ÑÒ»¸öÖµ´«µÝ¸ø¹ý³Ì£¬ÓÖ°ÑÐÂÖµ·µ»Ø¸øµ÷Óùý³ÌµÄ´úÂë¡£µ±ÄãÖ´ÐÐÍêÒÔÏ´úÂëʱ£º
var
X: Integer;
begin
X := 10;
DoubleTheValue (X);
x±äÁ¿µÄÖµ±ä³ÉÁË20 ......