Click here to Skip to main content
15,897,181 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Updated 22-Aug-12 1:50am
v2

1 solution

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.
 
Share this answer
 
v2
Comments
Fresher16 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 M 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.
Fresher16 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 M 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 M 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.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900