but before I did any thing when I try to see the print preview of my code I got this exception:
First-chance exception at 0x760cc6e3 (KernelBase.dll) in patron1.exe: Microsoft C++ exception: long at memory location 0x001fe8e0..
I thought that happened because of the mapping mode I used which is MM_LOMETRIC so I add virtual function to define it:
void Cpatron1View::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo)
{
pDC->SetMapMode(MM_LOMETRIC);
SetGraphicsMode(NULL,GM_ADVANCED);
CScrollView::OnPrepareDC(pDC, pInfo);
}
but I also get the same exception
I also try to change the onprepareprinting function definition by
add CDC* pDC as parameter:
BOOL Cpatron1View::OnPreparePrinting(CDC* pDC,CPrintInfo* pInfo)
{
pDC->SetMapMode(MM_LOMETRIC);
SetGraphicsMode(NULL,GM_ADVANCED);
return DoPreparePrinting(pInfo);
}
when I did that the exception did not happened but when I click on the print preview the program got Stuck(I do not know I am using the right word but I mean the run got frozen and I can not do anything)
I am using visual studio c++ 2010 to create MFC project
could you please tell me what I did wrong??
thanks alot

New Topic/Question
Reply


MultiQuote



|