Click here to Skip to main content
15,886,919 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to use this template with varying sizes? Pin
Stephen Hewitt31-Oct-07 19:45
Stephen Hewitt31-Oct-07 19:45 
AnswerRe: How to use this template with varying sizes? Pin
John R. Shaw31-Oct-07 23:48
John R. Shaw31-Oct-07 23:48 
AnswerRe: How to use this template with varying sizes? Pin
Stephen Hewitt1-Nov-07 17:50
Stephen Hewitt1-Nov-07 17:50 
QuestionOnPrint with MFC Pin
mnnca31-Oct-07 7:08
mnnca31-Oct-07 7:08 
AnswerRe: OnPrint with MFC Pin
Gofur Halmurat31-Oct-07 7:10
Gofur Halmurat31-Oct-07 7:10 
GeneralRe: OnPrint with MFC Pin
mnnca31-Oct-07 7:29
mnnca31-Oct-07 7:29 
QuestionRe: OnPrint with MFC Pin
Mark Salsbery31-Oct-07 7:16
Mark Salsbery31-Oct-07 7:16 
AnswerRe: OnPrint with MFC Pin
mnnca31-Oct-07 7:34
mnnca31-Oct-07 7:34 
I use standard code from MFC examples:
void CDISKVERView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo)
{
CDISKVERDoc* pDoc = GetDocument();
CScrollView::OnPrepareDC(pDC, pInfo);
pDC->SetMapMode(MM_ANISOTROPIC);
CSize sizeDoc = pDoc->GetDocSize();
sizeDoc.cy = -sizeDoc.cy;
pDC->SetWindowExt(sizeDoc);
CSize sizeNum, sizeDenom;
sizeNum.cx=1;
sizeNum.cy=1;
sizeDenom.cx=1;
sizeDenom.cy=1;
//debug mode works ok
//release mode doesnt work !!dont know why
// GetZoomFactor(&sizeNum, &sizeDenom); this is not a valid function, why?
int xLogPixPerInch = pDC->GetDeviceCaps(LOGPIXELSX);
int yLogPixPerInch = pDC->GetDeviceCaps(LOGPIXELSY);
long xExt = (long)sizeDoc.cx * xLogPixPerInch * sizeNum.cx;
xExt /= 100 * (long)sizeDenom.cx;
long yExt = (long)sizeDoc.cy * yLogPixPerInch * sizeNum.cy;
yExt /= 100 * (long)sizeDenom.cy;
pDC->SetViewportExt((int)xExt, (int)-yExt);
}
The Print function:
pDC->TextOut(x,y, String1);

When I compile it in debug mode, the output/document is ok.
when I compile it in release mode, the output is a blank page.

Thanks.
Mandy



mnnca

GeneralRe: OnPrint with MFC Pin
Mark Salsbery31-Oct-07 8:37
Mark Salsbery31-Oct-07 8:37 
GeneralRe: OnPrint with MFC Pin
mnnca31-Oct-07 11:06
mnnca31-Oct-07 11:06 
GeneralRe: OnPrint with MFC Pin
Mark Salsbery1-Nov-07 5:32
Mark Salsbery1-Nov-07 5:32 
GeneralRe: OnPrint with MFC Pin
mnnca2-Nov-07 10:16
mnnca2-Nov-07 10:16 
GeneralRe: OnPrint with MFC Pin
mnnca7-Nov-07 7:58
mnnca7-Nov-07 7:58 
GeneralRe: OnPrint with MFC Pin
Mark Salsbery7-Nov-07 9:45
Mark Salsbery7-Nov-07 9:45 
GeneralRe: OnPrint with MFC Pin
mnnca7-Nov-07 10:54
mnnca7-Nov-07 10:54 
GeneralRe: OnPrint with MFC Pin
Mark Salsbery7-Nov-07 11:04
Mark Salsbery7-Nov-07 11:04 
GeneralRe: OnPrint with MFC Pin
mnnca7-Nov-07 11:13
mnnca7-Nov-07 11:13 
GeneralRe: OnPrint with MFC Pin
Mark Salsbery7-Nov-07 11:31
Mark Salsbery7-Nov-07 11:31 
GeneralRe: OnPrint with MFC Pin
mnnca7-Nov-07 11:37
mnnca7-Nov-07 11:37 
GeneralRe: OnPrint with MFC Pin
Nelek1-Nov-07 22:00
protectorNelek1-Nov-07 22:00 
GeneralRe: OnPrint with MFC Pin
mnnca2-Nov-07 10:14
mnnca2-Nov-07 10:14 
QuestionHide cursor on CEdit? Pin
Gofur Halmurat31-Oct-07 6:41
Gofur Halmurat31-Oct-07 6:41 
QuestionRe: Hide cursor on CEdit? Pin
Mark Salsbery31-Oct-07 7:04
Mark Salsbery31-Oct-07 7:04 
AnswerRe: Hide cursor on CEdit? Pin
Gofur Halmurat31-Oct-07 7:07
Gofur Halmurat31-Oct-07 7:07 
GeneralRe: Hide cursor on CEdit? Pin
Mark Salsbery31-Oct-07 7:13
Mark Salsbery31-Oct-07 7:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.