Delphi spcomm ¿Ø¼þ - Delphi / ÍøÂçͨÐÅ/·Ö²¼Ê½¿ª·¢
´óÏÀÃÇ°ï濴һϣ¬ÓÃspcomm¿Ø¼þ½øÐд®¿ÚͨÐÅ¡£
·¢ËÍÊý¾Ý£º
procedure TForm1.Button2Click(Sender: TObject);
var
strPressure:string;
begin
strPressure:='SEND'+#13;
comm1.WriteCommData(pchar(strPressure),Length(strPressure));
end;
½ÓÊÕÊý¾Ý£º
procedure TForm1.Comm1ReceiveData(Sender: TObject; Buffer: Pointer;
BufferLength: Word);
var
RecvBuf:string;
strPressure:string;
str:string;
begin
Setlength(RecvBuf,BufferLength);
move(buffer^,pchar(recvbuf)^,bufferlength);
strPressure:=recvbuf;
strPressure:=MidStr(strPressure,7,bufferlength-6);
strPressure:=LeftStr(strPressure,bufferlength-10);
str:='ѹǿÊÇ£º'+strPressure;
memo1.Lines.Add(str);
end
end;
¸øÆøѹ´«¸ÐÆ÷ͨÐÅ£¬µ«ÊÇTForm1.Comm1ReceiveData´Ëʼþ¾ÍûÓд¥·¢¹ý£¬ÎªºÎѽ?
Õ⼸ÌìÕâ¸öÎÊÌâºÃ¶à¡£¡£¡£
°ÑÄãµÄSpComm¿Ø¼þÊôÐÔÒ³ÀËùÓÐTrueµÄµØ·½¶¼¸ÄΪFalseÔÙÊÔ¡£
ÊDz»ÊÇ這個ÃüÁî無Ч°¡
(Ц°ÔÍõ) :
ÄÜÏêϸ½²½âÉèÖÃfalseÄǼ¸¸öÊôÐÔµÄ×÷ÓÃÂð£¿
ÄãÓ¦¸Ãµ½ÍøÉÏÈ¥Ê×ÏÈÑо¿Ò»Ï£¬Õ⼸¸öÊôÐÔµÄ×÷Óã¬ÄãÕâÑù±à³ÌÐò£¬¿Ï¶¨±à²»ºÃ
Ïà¹ØÎÊ´ð£º
delphi ÊÖ¶¯×°ÔØÇý¶¯ÎļþÌáʾ£º
RROR (1058): The driver is marked as disabled (Start=4) in its service database entry.
ÊDz»ÊÇÕâ¸öÇý¶¯±ØÐèÒªÓÃINFÀ´°²×°¡£¡£ÓÃ×Ô´øµÄINFÀ´×°ÊÇÕý³£µÄ¡£ÓÃÊÖ¶¯×°ÔؾÍÌáʾÈçÉÏ¡ ......
Àý×Ó³ÌÐò¼û¸½¼þ£¬ÓÃDelphi 7½øÐбàÒë
ÎÊÌâ´úÂëΪ
Delphi(Pascal) code:
if Node.ChildNodes <> nil then
begin
for i := 0 to Node.ChildNodes.Count - 1 do
begin
cNode := N ......
¶¨Òå±äÁ¿s,sqlΪstringÀàÐÍ£¬sΪº¯Êý²ÎÊý£¬sql£º='select field1 from table1 where'+s;ÔËÐÐʱs¸³ÖµÎªid>7»òÕßid<7¡¢id=7,µ«ÊÇÔËÐÐʱ×ÜÊdzö´í£¬Çë¸÷λ°ïÎÒ¸Ä´í£¬¶àл£¡
showMessage(sql)Ï¿´¿´
sql£º='sel ......
³ÌÐò¹Ø±ÕµÄʱºò³öÏÖÒì³££º
exception EAccessviolation in moudule JGJC.exe at C08BB35B Access wiolation at address C08BC35B.Read of address C08BC35B.
ÇëÎÊÒ»ÏÂÕâÊÇʲôÒâ˼°¡£¿
·ÃÎÊÔ½½ç
ÊÇ·ñ·ÃÎÊÁËÒѱ»Ê ......