Click here to Skip to main content
15,900,461 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Help needed! Pin
Steen Krogsgaard24-Feb-05 22:18
Steen Krogsgaard24-Feb-05 22:18 
GeneralRe: Help needed! Pin
Ryan Binns25-Feb-05 1:06
Ryan Binns25-Feb-05 1:06 
GeneralHandling messages in another class Pin
tttyip23-Feb-05 0:25
tttyip23-Feb-05 0:25 
GeneralRe: Handling messages in another class Pin
RChin23-Feb-05 0:51
RChin23-Feb-05 0:51 
Generalmerge some cells from the same row in CListCtrl Pin
catalin buj23-Feb-05 0:14
catalin buj23-Feb-05 0:14 
GeneralRe: merge some cells from the same row in CListCtrl Pin
bitpusher23-Feb-05 9:56
bitpusher23-Feb-05 9:56 
GeneralRe: merge some cells from the same row in CListCtrl Pin
catalin buj23-Feb-05 22:19
catalin buj23-Feb-05 22:19 
GeneralProblem with metafile-playback in print preview Pin
Christian Waluga22-Feb-05 23:35
Christian Waluga22-Feb-05 23:35 
Hi everybody,
I have a problem, which I could not solve myself and I hope somebody has made some experiences with CMetaFileDC. First of all: My Code works on onscreen-DCs and what comes out of my printer looks exactly as I want. My only problem is rendering a metafile to a print-preview-DC. The result is always way to large and does not fit the page. It seems that the preview-dc behaves like a printing-dc and PlayMetaFile ignores that.

Some example code (like mine but without unnecessary details):
<br />
// create metafile<br />
CSize ext(cx, cy);<br />
pDC->DPtoHIMETRIC(&ext);<br />
CMetaFileDC mdc;<br />
mdc.CreateEnhanced(pDC, 0, CRect(CPoint(0, 0), ext), 0);<br />
<br />
// draw something to my dc.<br />
drawObjects(mdc);<br />
<br />
// get width and height of the page<br />
ext.SetSize(pDC->GetDeviceCaps(PHYSICALWIDTH) - 2 * pDC->GetDeviceCaps(PHYSICALOFFSETX),<br />
  pDC->GetDeviceCaps(PHYSICALHEIGHT) - 2 * pDC->GetDeviceCaps(PHYSICALOFFSETY));<br />
<br />
// finish metafile and render to pDC<br />
HENHMETAFILE hMf = mdc.CloseEnhanced();<br />
CRect bounds(CPoint(0, 0), ext);<br />
pDC->SaveDC();<br />
pDC->SetMapMode(MM_ANISOTROPIC);<br />
pDC->PlayMetaFile(hMf, &bounds);<br />
pDC->RestoreDC(-1);<br />
<br />
// clean up<br />
DeleteEnhMetaFile(hMf);<br />


If necessary I can make some screenshots of that effect.

Thanks for readingSmile | :) ,
Christian
GeneralRe: Problem with metafile-playback in print preview Pin
Christian Waluga23-Feb-05 22:15
Christian Waluga23-Feb-05 22:15 
GeneralUse C++ written class in VB Pin
Logan from Singapore22-Feb-05 23:33
Logan from Singapore22-Feb-05 23:33 
GeneralRe: Use C++ written class in VB Pin
ThatsAlok22-Feb-05 23:52
ThatsAlok22-Feb-05 23:52 
Generalappend CString [] Pin
kittunair22-Feb-05 23:28
kittunair22-Feb-05 23:28 
GeneralRe: append CString [] Pin
ThatsAlok22-Feb-05 23:50
ThatsAlok22-Feb-05 23:50 
GeneralRe: append CString [] Pin
David Nash23-Feb-05 7:03
David Nash23-Feb-05 7:03 
GeneralDate Validation Pin
Renjith Ramachandran22-Feb-05 23:16
Renjith Ramachandran22-Feb-05 23:16 
GeneralRe: Date Validation Pin
David Crow23-Feb-05 2:40
David Crow23-Feb-05 2:40 
GeneralRe: Date Validation Pin
James R. Twine23-Feb-05 2:51
James R. Twine23-Feb-05 2:51 
GeneralRe: Date Validation Pin
anand_study17-May-05 19:47
anand_study17-May-05 19:47 
Generalmalloc fails Pin
Jay Carter22-Feb-05 23:00
Jay Carter22-Feb-05 23:00 
GeneralRe: malloc fails Pin
$8823-Feb-05 1:33
$8823-Feb-05 1:33 
GeneralRe: malloc fails Pin
Mike Dimmick23-Feb-05 2:30
Mike Dimmick23-Feb-05 2:30 
GeneralRe: malloc fails Pin
Jay Carter23-Feb-05 3:30
Jay Carter23-Feb-05 3:30 
GeneralRe: malloc fails Pin
Neville Franks23-Feb-05 9:02
Neville Franks23-Feb-05 9:02 
QuestionTo set modified time of a file as current time? Pin
Monisankar22-Feb-05 22:50
Monisankar22-Feb-05 22:50 
AnswerRe: To set modified time of a file as current time? Pin
Monisankar22-Feb-05 23:36
Monisankar22-Feb-05 23:36 

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.