-
April 21st, 2009, 06:59 PM
#1
[RESOLVED] printing files (or richTextBox in Forms)
Hi, guys.
What I really want to do is to print a richTextBox from inside my app. However, after looking around, that looks like it will take about 100 lines of code, and I'd rather invest my time in adding other functionality.
Question:
If I save a temporary file, how can I print it from VC++ using windows rather than handling the print task within my app? (i.e. as though I'd right-clicked the file in windows and selected the "Print" option)
Alternatively:
Does someone have a good vc++ (i.e. non-VB) link for setting up a print document including rich text?
Thanks in advance for your help.
-
April 24th, 2009, 09:31 PM
#2
Re: printing files (or richTextBox in Forms)
Found a workable solution, if anyone else has this same question.
1) Save your richTextBox to a temp file.
2) (Straight from msdn but a little hard to find)
Code:
Process^ myProcess = gcnew Process;
myProcess->StartInfo->FileName = "..."; //... = path of the file
myProcess->StartInfo->Verb = "Print";
myProcess->StartInfo->CreateNoWindow = true;
myProcess->Start();
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|