Solved

VC++: How can print an external file within my application.

Posted on 1998-11-17
5
155 Views
Last Modified: 2013-11-20
I am saving my document in a txt format and would like to print this file within my application.
TX
m3
0
Comment
Question by:m3
  • 3
  • 2
5 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 50 total points
Comment Utility
Simply use 'ShellExecute()' and supply the name of the text file as the 'lpFile' parameter and "print" as the 'lpOperation' parameter, which will cause the file to be printed...
0
 

Author Comment

by:m3
Comment Utility
Is there a way to specify the setup for the printing before it prints?

0
 
LVL 86

Expert Comment

by:jkr
Comment Utility
Sorry, there's no way to do this, as the printing is actually done by the program that is registered for the '*.txt' file type (usually 'notepad.exe')...
0
 

Author Comment

by:m3
Comment Utility
When I use the .doc extention to save my file, and SW_HIDE as flag for the ShellExecute() function. the word document is not hided and is showed when printing. I would like to know whether there's a way to really hide it or why notepad.exe is hided but not Word.exe?
0
 
LVL 86

Expert Comment

by:jkr
Comment Utility
Well, i just can guess that the 'Word' programmers simply have chosen to ignore the 'SW_HIDE' flag - it's up to the application whether it uses it or not...
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
has22 challenge 11 70
How to convert MFC::CString to UTF8 wchar_t* 10 92
Thin secure Windows 10 5 46
Making an alias 7 51
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. …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

762 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

12 Experts available now in Live!

Get 1:1 Help Now