Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: MFC VC
Hello Everyone,
 
Can anyone please explain me how to use Print and preview option in a dialog based MFC App?
 
I'm trying to create a text editor and I have successfully done that.
 
Now I want to add a button for printing the same data but I don't know how to do it. could you give me any advice?
 
Extra notes:
I want to print the data from the edit box (Multiline and Read only) which i have implemented using ActiveX control "Microsoft Common Dialog control, version 6.0".
 
Thank you in advance.
Posted 21-Aug-12 21:33pm
Edited 22-Aug-12 2:50am
Joan Murt82.4K
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You should tell us how have you implemented this text editor, what you want to print...
 
Anyway, here are some links that might help:
 
http://www.google.com/search?hl=en&q=print+and+print+preview+mfc&rlz=1I7GGHP_esES472[^]
 
http://msdn.microsoft.com/en-us/library/aabc3hc6(v=vs.71).aspx[^]
 
http://msdn.microsoft.com/en-us/library/df9f4ta6(v=vs.80).aspx[^]
 
MFC Print preview extension DLL for dialogs[^]
 
http://msdn.microsoft.com/en-us/vstudio/bb879960.aspx[^]
 
As extra information, take a look at this page[^] were all the articles posted in CP with relationship to printing are.
Print and preview is what you are looking for, see that there is information for a lot of languages, but there is also information for VC.
 
Hope this helps you.
  Permalink  
v2
Comments
Anurag Kela at 22-Aug-12 6:19am
   
thanks joan but i want to use those functions on Dialog based App and not MDI? so pls help me with that..
Joan Murt at 22-Aug-12 6:27am
   
In the link named "MFC Print preview extension DLL for dialogs" you have a complete sample to do that.
Once again, improve the question explaining everyone in detail what you've done, what do you need exactly.
Anurag Kela at 22-Aug-12 7:22am
   
sorry to say but i have clearly mentioned about my need in my question above.
i have clearly mentioned that i need that for my dialog based app.
n if u haven't get that then i m explaining again.
 
i want to print the data from the edit box (Multiline and Read only) which i have implemented using ActiveX control "Microsoft Common Dialog control, version 6.0" . Can u help me now? The one given in "MFC Print preview extension DLL for dialogs" m not getting how to implement that? if possible pls help me with that
Joan Murt at 22-Aug-12 7:48am
   
Take a deep breath, I'm only trying to help.
If you read your question, you will see that there's no mention on an Editbox (which can be a CEdit, a CRichEdit or any specially designed control that allow you to edit) you neither say anything about any ActiveX control.
typically in CP you will get answers very very fast, I can see I'm the only one who has answered, probably this means that your question is not clear enough to try to help.
I'm not willing to bash you in any way, but the best way to get help here is to be as concise as possible.
I would recommend you to contact the author of the link that I've sent you he will be more than capable to help you with that.
I've used the "Improve question" green button in order to edit your question and add those new details there.
Joan Murt at 22-Aug-12 7:51am
   
It seems you've accepted my solution, don't do that or nobody else will look at your question, unmark it please. there are members that are only looking for questions that have still no answers. ;)
And mine is not an answer that has solved your issue.
Anurag Kela at 22-Aug-12 23:53pm
   
thanks for your help joan... m new to CP so was not knowing anything of what u said. will keep that in mind.
Joan Murt at 23-Aug-12 1:28am
   
Don't worry!
Now let's see if the article author or someone else can give you a proper answer.
Good luck with that.
Anurag Kela at 23-Aug-12 4:07am
   
Thanks...!!!
Anurag Kela at 23-Aug-12 4:14am
   
By the way joan can u help me with that "MFC Print Preview Extension DLL for Dialog"? when m compiling that project, it gives error that "afximpl.h" could not be found. I copied that file in directory but still there's some error in that file.
Joan Murt at 23-Aug-12 4:20am
   
I'm sorry, but I've never done that before, your best bet would be to put a code snippet that shows what is happening in your question, and then, while you try to get it done, see if anyone can answer you. Give as much detail as you can. Also remember to ask for help to the guy that posted that article here in CP... by the way... have you looked in the article section here in CP?
Joan Murt at 23-Aug-12 4:22am
   
See here: http://www.codeproject.com/KB/printing/#Print+Preview
links seem not to work in comments so I'll update the answer I posted before.
Anurag Kela at 23-Aug-12 4:24am
   
If u get some time then pls have a look at it once.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 7,903
1 Sergey Alexandrovich Kryukov 7,142
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,820


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 23 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100