Solved

Simple Printing

Posted on 1998-07-15
2
140 Views
Last Modified: 2013-11-20
I have a dlg app created in VC5 using the app wizard. It has a CString output to an edit box. I initially didn't want to print out the contents but if there is a quick way to set this up I might. What would be the easiest way to do this?
0
Comment
Question by:Grailman
2 Comments
 
LVL 2

Accepted Solution

by:
duneram earned 50 total points
Comment Utility
There is a real easy way to print the contents of an edit control under windows.  Its a bit of a back door

1)  Copy the contents of the edit control into a character buffer
2)  Create a file, and write the contents of the character buffer to the file
3)  Close the file
4)  Do a WinExec command and execute the string "notepad /p filename.txt"
    make sure you put the same filename in as the one you created.

5) the file will automatically be printed by the notepad executable.   Additionally if you use SW_HIDE you can hide the notepad window from the user as it prints.

Good luck
0
 
LVL 1

Author Comment

by:Grailman
Comment Utility
Worked like a charm. Thanks!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Host to IP 7 73
Process filename extension 3 156
tripleUp challenge 7 65
Problem to event 3 49
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now