Printing with C++ and Win32 API - TechRepublic
General discussion
July 14, 2000 at 01:58 PM
valager

Printing with C++ and Win32 API

by valager . Updated 25 years, 4 months ago

My program prints texts with graphics and so on. I need to change some printing attributes manually by program before print. This attributes is paper size, orientation, margins and so on.

So, I’ll describe what I am using for that and what I am thinking about all it.

So, what I am doing to print.

1 way:

I am initializing PRINTDLG structure with some attribures

PRINTDLG pd;

.
. initialization
.

and then I am calling PrintDlg(&pd); It gives me print context in pd.hDC and I can print. To change some attributes in this way I need to initialize hDevMode member of PRINTDLG structure. It’s declared as HANDLE hDevMode. It’s a global handle to DEVMODE structure consists of print attributes. But I can’t do it. If I’ll find answer, how to initialize this member, I will partially solve my problem.

That way can give me ability to change paper size and orientation. But I also want to change margins…..

2 way

I am initializing PAGESETUPDLG structure

PAGESETUPDLG ps;
.
. initializati

This discussion is locked

All Comments