Solved

Simple Printing

Posted on 1998-07-15
2
142 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
ID: 1319247
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
ID: 1319248
Worked like a charm. Thanks!
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

809 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