Hi,
I am migrating my project from VC++ 6.0 to VC++ 2008.I have been successful in doing so until now,where I am stuck up with Priint Preview part of the project.I have googled for this, and made some changes to my code.I find no compilation errors in the code,but The Print Preview editor doesn't launches itself.
I found that,making

CPrintDocument::IsPrintPreview_S()

forcefully false in the code while running,launches the Print Preview editor after some assertions.It launches with inaccuracies in the display.i.e., Scrollbar is not moving properly and others.

forcefully false in the code while running,launches the Print Preview editor after some assertions.It launches with inaccuracies in the display.i.e., Scrollbar is not moving properly and others.

As I said before,I have made these following code changes,

What is CPrintDocument?
What is IsPrintPreview_S()?
Why did you make "code changes" in a working project?

July 16th, 2013, 10:26 PM

deepakbidap

Re: Migration of Print Preview code from VC++ 6.0 to VC++ 2008

CPrintdocument is a user defined class,sorry I thought it is one of those MFC classes.
static BOOL IsPrintPreview_S(); is the member function of CPrintdocument.
The code is from VC++ 6.0 where it is working,so after converting it to a VC++ 2008 project,it had compilation errors.So I had to make the above mentioned code changes.

I have never used Print Preview, but I have some comments and questions:

Quote:

Originally Posted by deepakbidap

I have googled for this,

Why not just debug to see why the window doesn't open? I don't get why a lot of people think "googling" is supposed to replace the debugger.

Quote:

and made some changes to my code.I find no compilation errors in the code,but The Print Preview editor doesn't launches itself.

Do you know why you made those changes, or you just made changes to make the code compile?

According to your changes (please use code tags when posting code), you changed much more than just to get the program to compile. If you were making changes due to differences in the C++ language between VC 6 and VC 2008, that's one thing. However, you didn't make this type of change -- you changed the way the program works by pointing to a different window -- that is a different type of "change" altogether. Do you know what the implications are of doing this?

Please, don't post screenshots, if no one asked it. It is very hard to "read"/find any useful info from such a picture, especially if one looks for variable values or function return valus.

It is also very hard to discuss your problem with you since you post new variant of your code in every new post!

Well, could you create a very small test project that can reproduce your problem and post it in a zip archive? Then we'd try to investigate it with debugger to understand what happens.
Please, do not include debug/relese folder nor .aps, .ncb, .res, .opt files.