Click here to Skip to main content
16,016,157 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerAddition: sdi: multiple frames within a view Pin
b_e_n_8231-Oct-06 23:00
b_e_n_8231-Oct-06 23:00 
QuestionHelp! print issue Pin
hongmuer31-Oct-06 5:59
hongmuer31-Oct-06 5:59 
AnswerRe: Help! print issue Pin
bob1697231-Oct-06 6:52
bob1697231-Oct-06 6:52 
GeneralRe: Help! print issue Pin
hongmuer31-Oct-06 7:50
hongmuer31-Oct-06 7:50 
GeneralRe: Help! print issue Pin
bob1697231-Oct-06 8:31
bob1697231-Oct-06 8:31 
GeneralRe: Help! print issue Pin
bob1697231-Oct-06 10:56
bob1697231-Oct-06 10:56 
GeneralRe: Help! print issue Pin
hongmuer1-Nov-06 15:50
hongmuer1-Nov-06 15:50 
GeneralRe: Help! print issue Pin
hongmuer1-Nov-06 16:30
hongmuer1-Nov-06 16:30 
I added following codes in OnDraw function
	if(pDC->IsPrinting())<br />
	{<br />
<pre>pDC->SetMapMode(MM_ISOTROPIC);<br />
pDC->StretchBlt(100,-100,pDC->GetDeviceCaps(HORZRES),-pDC->GetDeviceCaps(VERTRES),<br />
		m_pMemDC,0,0, 6*m_nMaxX/5,m_nMaxY,SRCCOPY);<br />
</pre>}


and in OnPrepareDC function, codes has been added as follow:
	if(pDC->IsPrinting())<br />
	{<br />
<pre>pDC->SetMapMode(MM_ISOTROPIC);<br />
		<br />
int nPageWidth = pDC->GetDeviceCaps(PHYSICALWIDTH); <br />
int nPageHeight = pDC->GetDeviceCaps(PHYSICALHEIGHT); <br />
		<br />
CSize size = CSize(nPageWidth, nPageHeight); <br />
pDC->SetWindowExt(size);<br />
		<br />
pDC->SetViewportExt(pDC->GetDeviceCaps(HORZRES),-pDC->GetDeviceCaps(VERTRES));</pre><br />
}


Now, I can get the correct view in print preview!
Thank you very much!
By the way, I think I am still confused in print issue, such as mapping, the difference between the window and view, etc. Could you please recommend some literatures for me?
GeneralRe: Help! print issue Pin
bob1697210-Nov-06 19:26
bob1697210-Nov-06 19:26 
QuestionVC++ MSN Client [modified] Pin
priyank_ldce31-Oct-06 5:40
priyank_ldce31-Oct-06 5:40 
AnswerRe: VC++ MSN Client Pin
Mark Salsbery31-Oct-06 5:49
Mark Salsbery31-Oct-06 5:49 
GeneralRe: VC++ MSN Client Pin
priyank_ldce31-Oct-06 5:57
priyank_ldce31-Oct-06 5:57 
QuestionMmm n00b question about File I/O Pin
Anthony Mushrow31-Oct-06 5:19
professionalAnthony Mushrow31-Oct-06 5:19 
AnswerRe: Mmm n00b question about File I/O Pin
David Crow31-Oct-06 5:23
David Crow31-Oct-06 5:23 
GeneralRe: Mmm n00b question about File I/O Pin
Anthony Mushrow31-Oct-06 6:31
professionalAnthony Mushrow31-Oct-06 6:31 
AnswerRe: Mmm n00b question about File I/O Pin
toxcct31-Oct-06 5:25
toxcct31-Oct-06 5:25 
QuestionHelp!(something about the pointer) Pin
wanlim081731-Oct-06 5:18
wanlim081731-Oct-06 5:18 
AnswerRe: Help!(something about the pointer) Pin
Anthony Mushrow31-Oct-06 5:22
professionalAnthony Mushrow31-Oct-06 5:22 
AnswerRe: Help!(something about the pointer) [modified] Pin
toxcct31-Oct-06 5:33
toxcct31-Oct-06 5:33 
AnswerRe: Help!(something about the pointer) Pin
David Crow31-Oct-06 5:36
David Crow31-Oct-06 5:36 
Generalconst or not ? Pin
toxcct31-Oct-06 5:41
toxcct31-Oct-06 5:41 
GeneralRe: const or not ? Pin
David Crow31-Oct-06 5:57
David Crow31-Oct-06 5:57 
GeneralRe: const or not ? Pin
toxcct31-Oct-06 5:59
toxcct31-Oct-06 5:59 
QuestionNMAKE error Pin
mmhu31-Oct-06 5:15
mmhu31-Oct-06 5:15 
QuestionRe: NMAKE error Pin
David Crow31-Oct-06 5:40
David Crow31-Oct-06 5:40 

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.