Hello. I can not print plain text of several characters. I use this function here https://msdn.microsoft.com/en-us/library/windows/desktop/dd162959(v=vs.85).aspx
Here is the code of the console application that starts the function:
int _tmain(int argc, _TCHAR* argv[]) { LPTSTR printerName = (LPTSTR)_T("XP-58"); CString str = "la-la-la"; LPBYTE pByte = new BYTE[str.GetLength() + 1]; memcpy(pByte, (VOID*)LPCTSTR(str), str.GetLength()); DWORD count = 7; BOOL result = RawDataToPrinter(printerName, pByte, count); std::cout << result << std::endl; system("pause"); return 0; } The printer name is correct, it opens, because the number 1 is written in the console after the completion of work.
The problem is that the document is added to the print queue, and immediately removed from there, as if already printed, although the printer did not print anything at all.
There are suspicions that something with a printer port, it is connected to USB002. When I send to print something from a notebook, then in the print queue you can see that the USB002 port is registered, but through my program there is a task in the print queue without a port.
How to set the printer port when opened? Or maybe I have another problem?
new BYTEfor some reason. - Athari