Click here to Skip to main content
15,911,030 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionReplacing or Changing open/save file dialog for winXP and vista Pin
Gilvinit16-Feb-09 9:31
Gilvinit16-Feb-09 9:31 
AnswerRe: Replacing or Changing open/save file dialog for winXP and vista Pin
David Crow16-Feb-09 9:47
David Crow16-Feb-09 9:47 
QuestionPrinting using GDI Pin
Steve_16-Feb-09 8:59
Steve_16-Feb-09 8:59 
AnswerRe: Printing using GDI Pin
Code-o-mat16-Feb-09 10:31
Code-o-mat16-Feb-09 10:31 
GeneralRe: Printing using GDI Pin
Steve_16-Feb-09 10:40
Steve_16-Feb-09 10:40 
AnswerRe: Printing using GDI Pin
frx9616-Feb-09 14:33
frx9616-Feb-09 14:33 
AnswerRe: Printing using GDI Pin
frx9616-Feb-09 14:33
frx9616-Feb-09 14:33 
AnswerRe: Printing using GDI Pin
frx9616-Feb-09 14:36
frx9616-Feb-09 14:36 
also you can do like this:

PRINTDLGEX pd;
LPPRINTPAGERANGE ppr=NULL;
.......
ZeroMemory(&pd, sizeof(PRINTDLGEX));
pd.lStructSize = sizeof(PRINTDLGEX);
pd.hwndOwner = hwndFrame;
pd.hDevMode = NULL;
pd.hDevNames = NULL;
pd.Flags = PD_RETURNDC | PD_USEDEVMODECOPIESANDCOLLATE | PD_NOSELECTION;
pd.nCopies = 1;
/* by default print all pages */
pd.nPageRanges =1;
pd.nMaxPageRanges = MAXPAGERANGES;
ppr = (LPPRINTPAGERANGE)malloc(MAXPAGERANGES*sizeof(PRINTPAGERANGE));
pd.lpPageRanges = ppr;
ppr->nFromPage = 1;
ppr->nToPage = dm->pageCount();
pd.nMinPage = 1;
pd.nMaxPage = dm->pageCount();
pd.nStartPage = START_PAGE_GENERAL;

if (PrintDlgEx(&pd) == S_OK) {
if (pd.dwResultAction==PD_RESULT_PRINT) {
if (CheckPrinterStretchDibSupport(hwndFrame, pd.hDC)){
if (pd.Flags & PD_CURRENTPAGE) {
pd.nPageRanges=1;
pd.lpPageRanges->nFromPage=currentPageNo();
pd.lpPageRanges->nToPage =currentPageNo();
} else if (!(pd.Flags & PD_PAGENUMS)) {
pd.nPageRanges=1;
pd.lpPageRanges->nFromPage=1;
pd.lpPageRanges->nToPage =pageCount();
}
PrintToDevice(dm, pd.hDC, (LPDEVMODE)pd.hDevMode, pd.nPageRanges, pd.lpPageRanges);
}
}
}
else {
if (CommDlgExtendedError()) {
/* if PrintDlg was cancelled then
CommDlgExtendedError is zero, otherwise it returns the
error code, which we could look at here if we wanted.
for now just warn the user that printing has stopped
becasue of an error */
MessageBox(win->hwndFrame, "Cannot initialise printer", "Printing problem.", MB_ICONEXCLAMATION | MB_OK);
}
}

free(ppr);
if (pd.hDC != NULL) DeleteDC(pd.hDC);
if (pd.hDevNames != NULL) GlobalFree(pd.hDevNames);
if (pd.hDevMode != NULL) GlobalFree(pd.hDevMode);
}
AnswerRe: Printing using GDI Pin
«_Superman_»16-Feb-09 18:16
professional«_Superman_»16-Feb-09 18:16 
AnswerRe: Printing using GDI Pin
Iain Clarke, Warrior Programmer18-Feb-09 1:52
Iain Clarke, Warrior Programmer18-Feb-09 1:52 
QuestionHow to compile a native (ie. using NT API instead of Win32) x64 app ? Pin
Defenestration16-Feb-09 7:50
Defenestration16-Feb-09 7:50 
AnswerRe: How to compile a native (ie. using NT API instead of Win32) x64 app ? Pin
Richard Andrew x6416-Feb-09 16:30
professionalRichard Andrew x6416-Feb-09 16:30 
AnswerRe: How to compile a native (ie. using NT API instead of Win32) x64 app ? Pin
«_Superman_»16-Feb-09 18:19
professional«_Superman_»16-Feb-09 18:19 
QuestionProblem with dll... Pin
Member Ártemis16-Feb-09 5:28
Member Ártemis16-Feb-09 5:28 
AnswerRe: Problem with dll... Pin
Taran916-Feb-09 6:03
Taran916-Feb-09 6:03 
GeneralRe: Problem with dll... Pin
Member Ártemis16-Feb-09 7:09
Member Ártemis16-Feb-09 7:09 
AnswerRe: Problem with dll... Pin
CPallini16-Feb-09 6:52
mveCPallini16-Feb-09 6:52 
GeneralRe: Problem with dll... Pin
Member Ártemis16-Feb-09 7:18
Member Ártemis16-Feb-09 7:18 
GeneralRe: Problem with dll... Pin
CPallini16-Feb-09 7:38
mveCPallini16-Feb-09 7:38 
GeneralRe: Problem with dll... Pin
regnwald16-Feb-09 18:44
regnwald16-Feb-09 18:44 
GeneralRe: Problem with dll... Pin
CPallini16-Feb-09 21:34
mveCPallini16-Feb-09 21:34 
GeneralRe: Problem with dll... Pin
CPallini16-Feb-09 21:44
mveCPallini16-Feb-09 21:44 
AnswerRe: Problem with dll... Pin
Richard Andrew x6416-Feb-09 16:37
professionalRichard Andrew x6416-Feb-09 16:37 
GeneralRe: Problem with dll... Pin
Member Ártemis16-Feb-09 23:04
Member Ártemis16-Feb-09 23:04 
GeneralRe: Problem with dll... Pin
Richard Andrew x6417-Feb-09 2:00
professionalRichard Andrew x6417-Feb-09 2:00 

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.