有谁在网页里调用过MSCOMM控件没有?(45分)

  • 主题发起人 主题发起人 爱上寂寞
  • 开始时间 开始时间

爱上寂寞

Unregistered / Unconfirmed
GUEST, unregistred user!
我在网页里用javascript调用MSComm
怎么才能取到缓冲区里的数据???
代码如下:
<object id=&quot;PrintOCX&quot;
classid=&quot;clsid:648A5600-2C6E-101B-82B6-000000000014&quot;
width=&quot;0&quot;
height=&quot;0&quot;
codebase=&quot;service.ecity.com/ocx/MSCOMM32.OCX&quot;>
</object>
<script language=&quot;javascript&quot;>
function PrintVoucher()
{
var Buffer;
PrintOCX.CommPort=&quot;1&quot;;
if(PrintOCX.PortOpen!=&quot;TRUE&quot;)
{
PrintOCX.Settings=&quot;9600,n,8,1&quot;;
//PrintOCX.InputLen=&quot;0&quot;;
PrintOCX.PortOpen=&quot;TRUE&quot;;
}
// PrintOCX.Output=String.fromCharCode(27,64);

PrintOCX.Output=String.fromCharCode(16,4,1);
Buffer=PrintOCX.Input;
//这里取返回数据,怎么取不到??
alert(Buffer);
//------------------------------------------------
PrintOCX.Output=String.fromCharCode(29,40,70,4,0,1,0,1,1);
PrintOCX.Output=String.fromCharCode(29,12);
// 送黑标纸至打印起始位置
PrintOCX.Output=String.fromCharCode(27,100,5);
// 打印并进纸n字符行
PrintOCX.Output=&quot;中国人民/n&quot;;
PrintOCX.Output=String.fromCharCode(29,86,1);*/
PrintOCX.PortOpen=&quot;FALSE&quot;;

}
 
后退
顶部