不知道对你有没有用,下面的代码是用来打开接在打印口上的钱箱的!!Var
Mytext: TextFile;
buf: String;
Begin
Try
assignFile(Mytext, 'LPT1');
Rewrite(mytext);
buf := chr(27) + chr(112) + chr(0) + chr(21) + chr(32);
writeln(Mytext, buf);
closefile(mytext);
Except
closefile(mytext);
End;
Mytext: TextFile;
buf: String;
Begin
Try
assignFile(Mytext, 'LPT1');
Rewrite(mytext);
buf := chr(27) + chr(112) + chr(0) + chr(21) + chr(32);
writeln(Mytext, buf);
closefile(mytext);
Except
closefile(mytext);
End;
解决方案 »
- 急急!!两个combobox的问题,送分了。
- 结束进程时提示:系统检测到危害安全的尝试...这是如何实现的
- 如何判断事件指向的过程是否是指定过程
- 主從表的保存問題
- WideString 变量 如何判断里边装有多少字符
- 如何获得adoQuery对数据修改的每一条SQL语句??
- 对一类控件进行操作,如:对10个EDIT控件进行赋值操作。
- 关于ThemeEngine控件的问题,大虾请进!
- PaxScript脚本运行后怎么停止
- 如何在WEBBROWSER控件下载资源时,根据下载时间,控制进度条的进度。
- @@@@@@@怎样计算两个日期类型之间相差的天数(integer类型)???
- win2000上安装sqlserver6.5,需要什么补丁?在线等待!!!!!!!!!!!!
DWORD dwDesiredAccess, // access (read-write) mode
DWORD dwShareMode, // share mode
LPSECURITY_ATTRIBUTES lpSecurityAttributes, // pointer to security attributes
DWORD dwCreationDistribution, // how to create
DWORD dwFlagsAndAttributes, // file attributes
HANDLE hTemplateFile // handle to file with attributes to copy
); 创建一个并口句柄
然后创建线程用ReadFile( HANDLE hFile, // handle of file to read
LPVOID lpBuffer, // address of buffer that receives data
DWORD nNumberOfBytesToRead, // number of bytes to read
LPDWORD lpNumberOfBytesRead, // address of number of bytes read
LPOVERLAPPED lpOverlapped // address of structure for data
);对其进行监视即可