?
Solved

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

Posted on 1998-11-17
5
Medium Priority
?
169 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 200 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
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.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses

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