-
December 19th, 2011, 09:59 AM
#1
Print Preview
Hi guys, I was hoping to get some advice on adding a printing and print preview functionality to my program. The software currently has printing functionality that works, and it has preview functionality that somewhat works on XP only. The thing is, all of the code was written 10 years ago in PowerBuilder and converted to VC++ recently, so it's all written from scratch. I was hoping to find a way that would take advantage of some built in Microsoft/MFC functionality to make it easier on me.
Now, I've been searching for quite a while, and I've got a million ways to do it. Most recently, I found this DLL:
http://www.codeproject.com/KB/printi...extension.aspx
But, I don't know what the best way I should do it is, so I could use some advice.
I have an MFC application build using VS2008 with the 2008 Feature Pack installed. I have maybe 10 classes that have to do printing and I don't mind re-writing the printing functions from scratch. I would also prefer that the print preview window be a dialog, but I could work with it being a child window as well.
Anyway, I'm just at a loss of direction here. I don't know enough about it to know which is best, so hopefully you guys can give a few tips. Thanks in advance. I really appreciate this.
-
December 20th, 2011, 04:46 AM
#2
Re: Print Preview
Hi,
I didn't have the time to read your link. But as an idea:
To get to know how to do a print preview:
Create a new project with the wizard, enable the print preview feature. Imlpement something (simple) to draw.
Debug how the print preview stuff works there.
Implement it similary in your project.
If you've made your project "from the scratch" why didn't you use the print preview feature from the MFC wizzard created app?
Regards
PA
-
December 20th, 2011, 12:51 PM
#3
Re: Print Preview
Originally Posted by ProgramArtist
Hi,
I didn't have the time to read your link. But as an idea:
To get to know how to do a print preview:
Create a new project with the wizard, enable the print preview feature. Imlpement something (simple) to draw.
Debug how the print preview stuff works there.
Implement it similary in your project.
If you've made your project "from the scratch" why didn't you use the print preview feature from the MFC wizzard created app?
Regards
PA
Maybe I'm wrong here, but from what I understand, using the built in print preview requires the document/view framework, right? How do I add the doc/view framework to my app? Or does the app have to be built around that?
Also, I didn't start this from scratch. This project is over 10 years old. I'm just picking up where the last guy left off.
-
January 4th, 2012, 07:44 AM
#4
Re: Print Preview
Originally Posted by Access_Denied
Maybe I'm wrong here, but from what I understand, using the built in print preview requires the document/view framework, right? How do I add the doc/view framework to my app? Or does the app have to be built around that?
No, you aren't wrong here.
The built in preview feature of the MFC framework AFAIK depends from the doc/view style.
But nevertheless you can create an "empty" new project using the wizzard and see (via debugging) what's going on there. Then you can use this knowledge in your app (either by copy/paste portions of the MFC code or by reimplementing it similarly).
Originally Posted by Access_Denied
Also, I didn't start this from scratch. This project is over 10 years old. I'm just picking up where the last guy left off.
You wrote that you made things "from the scratch"; I quoted you here.
And if you would have started from the scratch then using the built in preview feature could be the easiest way.
In your case I think it is not possible to help you furthermore without having more info about your app.
"it has preview functionality that somewhat works on XP only":
What exactly happens in (which) other platforms?
Did you debug your code?
Did you get any assertions/errors/warnings?
With regards
PA
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
|