希望高人指导POS系统开钱箱的问题,谢谢!(200)

A

augur

Unregistered / Unconfirmed
GUEST, unregistred user!
使用StarTsp143U热敏打印机,USB接口,开箱的代码是ASCII 7。使用以下C++Builder代码:(打印机使用USBkou端口:USB002)HANDLE hwndFile;DWORD written;unsigned char ch;hwndFile = CreateFile("USB002",GENERIC_WRITE,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);ch = 0x07;WriteFile(hwndFile,&ch,1,&written,NULL);CloseHandle(hwndFile);运行不能打开钱箱。
 
T

tseug

Unregistered / Unconfirmed
GUEST, unregistred user!
· Call SetupDiGetClassDevs(interface_guid, 0, 0, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE) to get a list of devices. · Call SetupDiEnumDeviceInterfaces() to get a list of available device interfaces. · Call SetupDiGetDeviceInterfaceDetail() to fetch information for the actual device interface we are going to use. · Use the DevicePath member of the PSP_DEVICE_INTERFACE_DETAIL_DATA structure returned by the SetupDiGetDeviceInterfaceDetail() call as the devicename/filename in the CreateFile() call. · Call WriteFile() repeatedly to send data to the device. · Call CloseHandle() to close the device
 
A

augur

Unregistered / Unconfirmed
GUEST, unregistred user!
谢谢您的参与
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
683
import
I
顶部