Solved

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

Posted on 1998-11-17
5
157 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
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

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
repeatEnd java challenge 42 84
ORA-01403: no data found 43 90
WinWaitActive parameters 12 31
how to split multiple lines delimiter : 8 79
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

896 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

15 Experts available now in Live!

Get 1:1 Help Now