فهرست منبع

添加对并口打印的支持

zhangyang 6 سال پیش
والد
کامیت
3190ca2c65

BIN
bin/Win32/Release/lewaimai_pos_windows/lewaimai_pos_windows.exe


BIN
bin/Win32/Release/setup/lewaimai_pos_windows_setup_1.0.0.4.exe


+ 9 - 0
lewaimai_pos_windows/tool/CPosPrinter.cpp

@@ -40,6 +40,7 @@ bool CPosPrinter::InitShouyin()
     //LOG_INFO("nDevice:" << nDevice);
     int i = 0;
 
+	//添加usb端口
     while(i < nDevice)
     {
         Port = szDevicePath[i++];
@@ -60,6 +61,14 @@ bool CPosPrinter::InitShouyin()
 		m_hPorts.push_back(hPort);
     }
 
+	//开始添加并口的端口
+	std::wstring LptStr = L"lpt1";
+	HANDLE hPort = CreateFile(LptStr.c_str(), GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
+	if (hPort != INVALID_HANDLE_VALUE)
+	{
+		m_hPorts.push_back(hPort);
+	}
+
     return true;
 }