Click here to Skip to main content
15,921,660 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionUnresolved external symbol in vc++ Pin
harshadha15-Jan-07 21:17
harshadha15-Jan-07 21:17 
AnswerRe: Unresolved external symbol in vc++ Pin
prasad_som15-Jan-07 21:36
prasad_som15-Jan-07 21:36 
GeneralRe: Unresolved external symbol in vc++ Pin
harshadha15-Jan-07 22:35
harshadha15-Jan-07 22:35 
QuestionPrinter DC Pin
KKumarTG15-Jan-07 20:38
KKumarTG15-Jan-07 20:38 
AnswerRe: Printer DC Pin
Hamid_RT15-Jan-07 20:52
Hamid_RT15-Jan-07 20:52 
GeneralRe: Printer DC Pin
KKumarTG15-Jan-07 22:11
KKumarTG15-Jan-07 22:11 
GeneralRe: Printer DC Pin
Hamid_RT16-Jan-07 1:37
Hamid_RT16-Jan-07 1:37 
GeneralRe: Printer DC Pin
KKumarTG23-Jan-07 17:03
KKumarTG23-Jan-07 17:03 
Hi,

The way I change the paper size is given below

pDevModeOutput->dmPaperSize = 0; // It should be set to zero if paper length and width are given seperately
pDevModeOutput->dmPaperLength = pPaperSizes[nSelection].y; // 2970 in case A4
pDevModeOutput->dmPaperWidth = pPaperSizes[nSelection].x; // 2100 in case A4

CString csPaperSize = _T( "" );
memcpy( pDevModeOutput->dmFormName, csPaperSize.GetBuffer(csPaperSize.GetLength()), 32) ;
pDevModeOutput->dmPrintQuality = -1;
pDevModeOutput->dmYResolution = 0;
//pDevModeOutput->dmScale = 90;
pDevModeOutput->dmFields = DM_PAPERSIZE |
DM_PAPERLENGTH |
DM_PAPERWIDTH |
DM_FORMNAME |
DM_PRINTQUALITY |
DM_YRESOLUTION; // DM_SCALE;
// To get the Devmode structure filled
if( !DocumentProperties( NULL, // handle to parent window
hHandle, // handle to printer object
csPrinterName.GetBuffer(csPrinterName.GetLength()+1), // device name
pDevModeOutput, // modified device mode
0, // original device mode
DM_IN_BUFFER// mode options
))
{
return;
}

hDc = CreateDC( NULL, csPrinterName.operator LPCTSTR(), NULL, pDevModeOutput );

nDPIX = GetDeviceCaps( hDc, LOGPIXELSX );
nDPIY = GetDeviceCaps( hDc, LOGPIXELSY );

Actually I don't know the procedure that how to change the paper size. I think some mistakes are there in my code or something is missing. I have to draw a rectangle that is fit into the specified paper size.

Please reply.




Krishnakumar

GeneralRe: Printer DC Pin
Hamid_RT24-Jan-07 18:00
Hamid_RT24-Jan-07 18:00 
AnswerRe: Printer DC Pin
Iain Clarke, Warrior Programmer15-Jan-07 22:43
Iain Clarke, Warrior Programmer15-Jan-07 22:43 
GeneralRe: Printer DC Pin
KKumarTG15-Jan-07 23:00
KKumarTG15-Jan-07 23:00 
GeneralRe: Printer DC Pin
Iain Clarke, Warrior Programmer16-Jan-07 3:52
Iain Clarke, Warrior Programmer16-Jan-07 3:52 
GeneralRe: Printer DC Pin
KKumarTG23-Jan-07 1:06
KKumarTG23-Jan-07 1:06 
QuestionINI file size in XP Pin
Nishad S15-Jan-07 20:07
Nishad S15-Jan-07 20:07 
AnswerRe: INI file size in XP Pin
Hamid_RT15-Jan-07 20:28
Hamid_RT15-Jan-07 20:28 
AnswerRe: INI file size in XP Pin
Rajesh R Subramanian15-Jan-07 20:40
professionalRajesh R Subramanian15-Jan-07 20:40 
AnswerRe: INI file size in XP Pin
Don Box15-Jan-07 20:41
Don Box15-Jan-07 20:41 
GeneralRe: INI file size in XP Pin
Sebastian Schneider15-Jan-07 21:41
Sebastian Schneider15-Jan-07 21:41 
QuestionRe: INI file size in XP Pin
David Crow16-Jan-07 3:42
David Crow16-Jan-07 3:42 
Questionquestion about CreateFile and FILE_FLAG_WRITE_THROUGH Pin
George_George15-Jan-07 20:07
George_George15-Jan-07 20:07 
AnswerRe: question about CreateFile and FILE_FLAG_WRITE_THROUGH Pin
Michael Dunn15-Jan-07 22:21
sitebuilderMichael Dunn15-Jan-07 22:21 
GeneralRe: question about CreateFile and FILE_FLAG_WRITE_THROUGH Pin
George_George15-Jan-07 23:59
George_George15-Jan-07 23:59 
GeneralRe: question about CreateFile and FILE_FLAG_WRITE_THROUGH Pin
Michael Dunn16-Jan-07 8:03
sitebuilderMichael Dunn16-Jan-07 8:03 
GeneralRe: question about CreateFile and FILE_FLAG_WRITE_THROUGH Pin
George_George16-Jan-07 15:10
George_George16-Jan-07 15:10 
QuestionSpace key + menu operation Pin
Member 21206615-Jan-07 20:05
Member 21206615-Jan-07 20:05 

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.