Hello Thank you for your question and reaching out. I can understand you are having query\issues related to Printing in VC++. This below documents the Windows APIs that can be used to send raw data to a printer: http://msdn.microsoft.com/en-us/library/windows/desktop/dd162959(v=vs.85).aspx This should be fine if you only want to print simple text. --If the reply is helpful, please Upvote and Accept as answer--
I would like to see C++ code in visual studio WIN PC that simply accepts a name (fo example) and prints it out on an attached (USB or WiFi) printer.
I wish to see if this is possible. I assume it must be possible to send the output to a printer (as well as screen or file). Yes, I am very new to C++ and visual studio.
3 answers
Sort by: Most helpful
-
-
Castorix31 83,206 Reputation points
2023-04-25T07:29:17.1966667+00:00 Use StartDoc, StartPage, etc.. like in the old KB : KB139652
-
Jeanine Zhang-MSFT 9,431 Reputation points Microsoft Vendor
2023-04-25T09:12:20.8533333+00:00 Hello,
Welcome to Microsoft Q&A!
I suggest you could start from the Doc: Documents and Printing
You could refer to the samples:
Sending GDI+ Output to a Printer
Send raw data to a printer by using the Win32 API
Thank you.
Jeanine
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.