Click here to Skip to main content
15,907,687 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
Questiontwo dimension pointers Pin
hasani200722-Oct-10 10:00
hasani200722-Oct-10 10:00 
AnswerRe: two dimension pointers Pin
Nish Nishant23-Oct-10 5:03
sitebuilderNish Nishant23-Oct-10 5:03 
QuestionHow to start interrupted detection process again Pin
rajneshmalik21-Oct-10 2:00
rajneshmalik21-Oct-10 2:00 
AnswerRe: How to start interrupted detection process again Pin
Nish Nishant21-Oct-10 2:21
sitebuilderNish Nishant21-Oct-10 2:21 
QuestionMessage Removed Pin
20-Oct-10 19:59
loid grey manuel20-Oct-10 19:59 
AnswerRe: Auto Update My Application... Pin
Nish Nishant21-Oct-10 1:01
sitebuilderNish Nishant21-Oct-10 1:01 
GeneralRe: Auto Update My Application...[MOVED] Pin
loid grey manuel21-Oct-10 17:36
loid grey manuel21-Oct-10 17:36 
QuestionPrinting a metafile [modified] Pin
frqftgbdafr20-Oct-10 19:17
frqftgbdafr20-Oct-10 19:17 
I am working from a book that has me make a simple Paint program on an MFC SDI. It uses a metafile to store the GDI. I can save the metafile to disk, open the metafile from disk, but the book does not show me how to print the metafile to a printer. If I try to preview or print the document, I get a blank document.

I am saving the metafile this way...

void CPainterView::OnFileSave()
{
CPainterDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);

HMETAFILE MetaFileHandle = pDoc->pMetaFileDC->Close();
CopyMetaFile(MetaFileHandle, "painter.wmf");
CMetaFileDC* ReplacementMetaFile = new CMetaFileDC();
ReplacementMetaFile->Create();
ReplacementMetaFile->PlayMetaFile(MetaFileHandle);
DeleteMetaFile(MetaFileHandle);
delete pDoc->pMetaFileDC;
pDoc->pMetaFileDC = ReplacementMetaFile;
}


I showed you how the book saves the metafile because I have a feeling printing will be very similar.

With the MFC SDI, I have the print features...


BOOL CPainterView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}

void CPainterView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}

void CPainterView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}


Can I use any of these print features to print my metafile? Thank you

modified on Thursday, October 21, 2010 1:36 AM

AnswerRe: Printing a metafile Pin
Nish Nishant21-Oct-10 0:57
sitebuilderNish Nishant21-Oct-10 0:57 
QuestionWin32 .exe with out console. Pin
birajendu19-Oct-10 20:31
birajendu19-Oct-10 20:31 
AnswerRe: Win32 .exe with out console. Pin
Richard MacCutchan19-Oct-10 23:28
mveRichard MacCutchan19-Oct-10 23:28 
GeneralRe: Win32 .exe with out console. Pin
Nish Nishant20-Oct-10 4:01
sitebuilderNish Nishant20-Oct-10 4:01 
GeneralRe: Win32 .exe with out console. Pin
Richard MacCutchan20-Oct-10 4:22
mveRichard MacCutchan20-Oct-10 4:22 
AnswerRe: Win32 .exe with out console. Pin
Nish Nishant20-Oct-10 4:02
sitebuilderNish Nishant20-Oct-10 4:02 
Questionsearching registry keys. Pin
birajendu19-Oct-10 20:18
birajendu19-Oct-10 20:18 
AnswerRe: searching registry keys. Pin
Richard MacCutchan19-Oct-10 23:25
mveRichard MacCutchan19-Oct-10 23:25 
AnswerRe: searching registry keys. Pin
Nish Nishant20-Oct-10 4:00
sitebuilderNish Nishant20-Oct-10 4:00 
Questionhow to read a file in C++ Pin
rezen8518-Oct-10 18:01
rezen8518-Oct-10 18:01 
AnswerRe: how to read a file in C++ Pin
Richard MacCutchan18-Oct-10 22:46
mveRichard MacCutchan18-Oct-10 22:46 
GeneralRe: how to read a file in C++ Pin
rezen8518-Oct-10 23:05
rezen8518-Oct-10 23:05 
GeneralRe: how to read a file in C++ Pin
Richard MacCutchan19-Oct-10 0:21
mveRichard MacCutchan19-Oct-10 0:21 
AnswerRe: how to read a file in C++ Pin
Nish Nishant19-Oct-10 1:59
sitebuilderNish Nishant19-Oct-10 1:59 
QuestionMessage Removed Pin
15-Oct-10 2:20
ptr_Electron15-Oct-10 2:20 
AnswerRe: MFC Serilization :mechanism for splitting the serialize( ) method into Load() and Save() Pin
Nish Nishant15-Oct-10 7:19
sitebuilderNish Nishant15-Oct-10 7:19 
QuestionApplication crashes at RichEditCtrl.StremOut(), It says attempt to read write protected memory. this ffetne an indication that the other memory is corrupt Pin
ptr_Electron15-Oct-10 1:06
ptr_Electron15-Oct-10 1:06 

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.