关于MSComm的属性设置(50分)

P

PLWang

Unregistered / Unconfirmed
GUEST, unregistred user!
我的程序在代码里设置COMMEVENT:=2 InBufferCount:=0 还有就是Portopen:=true/false
然后 Run时 就有这样的错误出现
Error
Project Project1.exe raised exception class EOleException with message
'Property is read-only' . Process stopped. Use Step or Run to continue.
问一下这样设置是不是有什么问题?
 
CommEvent 属性:返回最近的通讯事件或错误。该属性在设计时无效,在运行时为只读
所以你不能设置它。
 
同意WYS205,建设给分他

给个例子你:
procedure tform1.mscomm1comm(sender: tobject);
var
recstr: olevariant;
begin
if mscomm1.commevent = 2 then
begin
recstr := mscomm1.input;
memo1.text := mem01.text + recstr;
end;
 
多人接受答案了。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
1K
DelphiTeacher的专栏
D
I
回复
0
查看
447
import
I
顶部