Click here to Skip to main content
15,890,399 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how can i change main tool bar button state ? Pin
Roger Allen19-Feb-03 6:00
Roger Allen19-Feb-03 6:00 
QuestionHow can i set different cursors of a view ? Pin
muna_utkal19-Feb-03 4:45
muna_utkal19-Feb-03 4:45 
AnswerRe: How can i set different cursors of a view ? Pin
Roger Allen19-Feb-03 5:18
Roger Allen19-Feb-03 5:18 
AnswerRe: How can i set different cursors of a view ? Pin
Iain Clarke, Warrior Programmer19-Feb-03 5:19
Iain Clarke, Warrior Programmer19-Feb-03 5:19 
GeneralWNetAddConnection2 Pin
Nic Oughton19-Feb-03 4:38
professionalNic Oughton19-Feb-03 4:38 
GeneralRe: WNetAddConnection2 Pin
Daniel Lohmann22-Feb-03 0:32
Daniel Lohmann22-Feb-03 0:32 
QuestionEnable Printing? Pin
Jon Hulatt19-Feb-03 4:37
Jon Hulatt19-Feb-03 4:37 
AnswerRe: Enable Printing? Pin
Roger Allen19-Feb-03 5:26
Roger Allen19-Feb-03 5:26 
If its an MFC Doc/View app, you need to have these entries in your MESSAGE_MAP to get the base print functions working

ON_COMMAND(ID_FILE_PRINT, CFormView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CFormView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CFormView::OnFilePrintPreview)


The above assumes your view is from CFormView. If not, change to the correct base class.

You may/will need to implement the following virtual function to get your output

virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo);


The most important being OnPrint() where you generate the actual output of the given page (pInfo->m_nCurPage) and OnPreparePrinting() where you can specify the actual number of pages to print.

Also, take a look at the printing articles here at CP. Any big problems, you can mail me direct as I am usually able to answer printing questions. Big Grin | :-D

Roger Allen
Sonork 100.10016

Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
GeneralRe: Enable Printing? Pin
Jon Hulatt19-Feb-03 6:38
Jon Hulatt19-Feb-03 6:38 
QuestionHow Can i change keydown event inside edit box? Pin
muna_utkal19-Feb-03 4:35
muna_utkal19-Feb-03 4:35 
AnswerRe: How Can i change keydown event inside edit box? Pin
adamUK19-Feb-03 9:04
adamUK19-Feb-03 9:04 
GeneralResizing parent with child. Pin
User 988519-Feb-03 4:35
User 988519-Feb-03 4:35 
GeneralRe: Resizing parent with child. Pin
valikac19-Feb-03 9:23
valikac19-Feb-03 9:23 
GeneralCopy protection help Pin
Stefan Dahlin19-Feb-03 4:13
Stefan Dahlin19-Feb-03 4:13 
GeneralRe: Copy protection help Pin
LiquidKnight19-Feb-03 6:48
LiquidKnight19-Feb-03 6:48 
GeneralRe: Copy protection help Pin
Toni7819-Feb-03 11:39
Toni7819-Feb-03 11:39 
GeneralRe: Copy protection help Pin
Stefan Dahlin19-Feb-03 11:43
Stefan Dahlin19-Feb-03 11:43 
GeneralStyle Question... Pin
work_to_live19-Feb-03 3:36
work_to_live19-Feb-03 3:36 
GeneralRe: Style Question... Pin
AlexO19-Feb-03 3:55
AlexO19-Feb-03 3:55 
GeneralLooking for light weight databases (performance is critical) Pin
Chen Venkataraman19-Feb-03 3:17
Chen Venkataraman19-Feb-03 3:17 
GeneralRe: Looking for light weight databases (performance is critical) Pin
AlexO19-Feb-03 3:57
AlexO19-Feb-03 3:57 
QuestionIs there a function which returns the file names? Pin
julych19-Feb-03 3:15
julych19-Feb-03 3:15 
AnswerRe: Is there a function which returns the file names? Pin
Hans Ruck19-Feb-03 3:21
Hans Ruck19-Feb-03 3:21 
GeneralRotation Pin
satyavasu19-Feb-03 2:53
satyavasu19-Feb-03 2:53 
GeneralRe: Rotation Pin
Chris Losinger19-Feb-03 8:56
professionalChris Losinger19-Feb-03 8:56 

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.