Solved

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

Posted on 1998-11-17
5
163 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 50 total points
ID: 1324827
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
ID: 1324828
Is there a way to specify the setup for the printing before it prints?

0
 
LVL 86

Expert Comment

by:jkr
ID: 1324829
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
ID: 1324830
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
ID: 1324831
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Expand macro to ask for filename column 8 40
format the code in java 6 116
only14 challenge 19 89
ERP and the other system process verification 5 25
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…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

732 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