Click here to Skip to main content
15,917,005 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Isolate value and perform arithmetic [C++] Pin
Shaitan003-Dec-04 11:03
Shaitan003-Dec-04 11:03 
GeneralPrinting Landscape mode Pin
Anonymous30-Nov-04 9:53
Anonymous30-Nov-04 9:53 
GeneralRe: Printing Landscape mode Pin
PJ Arends30-Nov-04 11:22
professionalPJ Arends30-Nov-04 11:22 
GeneralRe: Printing Landscape mode Pin
Anonymous30-Nov-04 11:37
Anonymous30-Nov-04 11:37 
GeneralRe: Printing Landscape mode Pin
PJ Arends30-Nov-04 12:21
professionalPJ Arends30-Nov-04 12:21 
GeneralRe: Printing Landscape mode Pin
Anonymous30-Nov-04 12:42
Anonymous30-Nov-04 12:42 
GeneralRe: Printing Landscape mode Pin
PJ Arends30-Nov-04 12:55
professionalPJ Arends30-Nov-04 12:55 
GeneralRe: Printing Landscape mode Pin
Anonymous30-Nov-04 15:01
Anonymous30-Nov-04 15:01 
Here is the code:

static LPDEVMODE pDevMode;
static PRINTDLG pd; // for PrintDlg()
static DOCINFO di;

// Set Up PRINTDLG Structure For PrintDlg()
memset( &pd, 0, sizeof(PRINTDLG) ); // Clear It
pd.lStructSize = sizeof(PRINTDLG); // Size
pd.hwndOwner = this->GetSafeHwnd();
pd.nFromPage = 1;
pd.nToPage = 1000;
pd.nMinPage = 1;
pd.nMaxPage = 1000;

pd.Flags = PD_RETURNDC | PD_PAGENUMS | PD_NOSELECTION | PD_HIDEPRINTTOFILE;
if( !PrintDlg(&pd)) return 1;
// landscape mode
pDevMode=NULL;
pDevMode = (LPDEVMODE)::GlobalLock(pd.hDevMode);
// set orientation to landscape
pDevMode->dmOrientation = DMORIENT_LANDSCAPE;
//pd.hDevMode = pDevMode;//Not needed

// Here is code for stuff to print...
// At end is the clean-up

::GlobalUnlock(pd.hDevMode);


Maybe the problem is that pDevMode is local variable, maybe I need to change some global variable, I just do not know what or how.
By the way I commented that line and it had no effect.

Thanks.
Joe,

GeneralRe: Printing Landscape mode Pin
PJ Arends30-Nov-04 16:28
professionalPJ Arends30-Nov-04 16:28 
GeneralRe: Printing Landscape mode Pin
lisoft30-Nov-04 15:10
lisoft30-Nov-04 15:10 
GeneralRe: Printing Landscape mode Pin
Anonymous30-Nov-04 16:02
Anonymous30-Nov-04 16:02 
GeneralRe: Printing Landscape mode Pin
lisoft30-Nov-04 16:16
lisoft30-Nov-04 16:16 
GeneralRe: Printing Landscape mode Pin
Anonymous30-Nov-04 16:26
Anonymous30-Nov-04 16:26 
GeneralRe: Printing Landscape mode Pin
lisoft30-Nov-04 17:53
lisoft30-Nov-04 17:53 
GeneralRe: Printing Landscape mode Pin
Anonymous30-Nov-04 19:04
Anonymous30-Nov-04 19:04 
QuestionHow to compile .exe without trash ? Pin
mirex30-Nov-04 9:24
mirex30-Nov-04 9:24 
AnswerRe: How to compile .exe without trash ? Pin
BlackDice30-Nov-04 10:16
BlackDice30-Nov-04 10:16 
GeneralRe: How to compile .exe without trash ? Pin
mirex1-Dec-04 4:54
mirex1-Dec-04 4:54 
GeneralRe: How to compile .exe without trash ? Pin
Blake Miller1-Dec-04 5:29
Blake Miller1-Dec-04 5:29 
GeneralRe: How to compile .exe without trash ? Pin
mirex2-Dec-04 3:28
mirex2-Dec-04 3:28 
GeneralRe: How to compile .exe without trash ? Pin
Blake Miller2-Dec-04 3:57
Blake Miller2-Dec-04 3:57 
GeneralRe: How to compile .exe without trash ? Pin
mirex2-Dec-04 20:29
mirex2-Dec-04 20:29 
GeneralRe: How to compile .exe without trash ? Pin
Blake Miller3-Dec-04 4:00
Blake Miller3-Dec-04 4:00 
GeneralRe: How to compile .exe without trash ? Pin
mirex3-Dec-04 22:42
mirex3-Dec-04 22:42 
Generalcrecordset moveNext truncate Pin
Anonymous30-Nov-04 9:19
Anonymous30-Nov-04 9:19 

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.