Click here to Skip to main content
15,913,685 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Updated 2-Jan-12 22:12pm
v2
Comments
cariolihome 1-Dec-11 17:50pm    
And what error was occurred ?
ppontheweb.hi 6-Dec-11 0:56am    
Sorry for the late reply....
but It's just the crash at the return statement and not defining any kind of error no or any description
Albert Holguin 6-Dec-11 10:37am    
You just said you "get the error in mfc80d.dll", how do you know that's where the error is if there's no error no. or any description?
Albert Holguin 6-Dec-11 10:36am    
Post the offending code, specify the error if any that is given.
ppontheweb.hi 7-Dec-11 5:05am    
when i run the code without breakpoints than it shows error in the mfc80d.dll and when i put the breakpoint than it goes to function and crashes there.....

1 solution

you shoul show some of the code.

I hope you have upgraded all used dll to VS 2005.
 
Share this answer
 

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