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

  • 主题发起人 主题发起人 augur
  • 开始时间 开始时间
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);运行不能打开钱箱。
 
· 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
 
谢谢您的参与
 
后退
顶部