Solved

Simple Printing

Posted on 1998-07-15
2
141 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
repeatSeparator  java  challenge 13 56
sumNumber challenge 16 112
Prevent this page from creating additional dialogs. 3 416
wait notify demo infinite loop 3 98
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

863 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

24 Experts available now in Live!

Get 1:1 Help Now