| 发表于:2007-02-28 16:00:06 楼主 |
dll的窗体上写的函数如下: function opencomm(scomm:string):longbool; begin try comm1.commname:=scomm; comm1.startcomm; messagedlg( '打开 '+scomm+ '串口成功! ',mtinformation,[mbyes],0); result:=true; except messagedlg( '打开 '+scomm+ '串口时失败,可能该串口已被占用或不存在,请换另一个串口! ',mterror,[mbyes],0); result:=false; end; end; 我用另一个程序来调用该dll的窗体上的上述函数时,却发现: comm1.commname:=scomm; comm1.startcomm; 这两条指令不能执行,请问是怎么原因呀? 调用的过程为: procedure tfcomm.btnopenclick(sender: tobject); begin opencomm( 'com1 '); end; 请各位大虾指点,谢谢。 |
|
|
|
|