July 16th, 2013, 06:02 AM
Migration of Print Preview code from VC++ 6.0 to VC++ 2008
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
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,
CWnd* pMainWnd = GetParentFrame();
if (DYNAMIC_DOWNCAST(CFrameWnd, pMainWnd) == NULL)
// if it's not a frame, we'll try the main window
pMainWnd = AfxGetMainWnd();
CFrameWnd* pParent = STATIC_DOWNCAST(CFrameWnd, pMainWnd);
CWnd* pToolBar = pParent->GetDlgItem(AFX_IDW_PREVIEW_BAR);
Thanks to anyone who helps me in this.
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!