Hi All,
I have upgraded code from vc6.0 to vs 2005. After removing all the compiler error i ran the code and found some breaking of the functionality like print preview. I debugged the code and found out that in vc6 version viewprev.cpp platform file was using
CFrameWnd* pParent = STATIC_DOWNCAST(CFrameWnd, AfxGetMainWnd());
ASSERT_VALID(pParent);
to get the parent and in vs2005 viewprev.cpp is using
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);
ASSERT_VALID(pParent);
to get the parent. I thought this was breaking the functionality than i did
CWnd* pMainWnd = AfxGetMainWnd();
this->SetParent(pMainWnd);
to achieve the same effect and it worked. but after doing this i was getting the print preview with no toolbar(which was present in vc6). And it is crashing when i close it.
Can anybody explain me the reason and answer why i am not getting the toolbar and why it is crashing or the soln to solve the problem?

regards