Solved

problems with TPrinter::Setup(TWindow* parent)

Posted on 1997-08-12
5
368 Views
Last Modified: 2008-03-06
Hallo there!
I'm using WIN95 and BC++5.01. There is a class TPrinter in the OWL wich have a function Setup(TWindow* parent). This function starts a dialog where U can choose the values of the border in the TPrinter object. All values I put there had no effect to my printing result. What's wrong there ? How can I choose the border values in an other way ?

Many thanks

        Swen
0
Comment
Question by:smeinert
  • 3
  • 2
5 Comments
 
LVL 4

Accepted Solution

by:
md041797 earned 200 total points
ID: 1167236
After calling Setup(), call
TPrintDialog::TData& printerData = Printer->GetSetup();
This will tell you wht the user has selected.
One element of printerData is Margin, a TRect.  When you output to the printer DC, use TDC::SelectClipRgn() to set this border before you render the page.
0
 

Author Comment

by:smeinert
ID: 1167237
Sorry, does not work.

1. Is not possible to do: TPrintDialog::TData& printerData =    Printer->GetSetup(); cause of operator '='
2. Any value in printerData.Margin has no effect to the printing    result althought I put it in my TPrintout::DC with the       function TDC::SelectClipRgn().

                 Swen

0
 
LVL 4

Expert Comment

by:md041797
ID: 1167238
1. Is not possible to do: TPrintDialog::TData& printerData = Printer->GetSetup(); cause of operator '='

GetSetup returns a TPrintDialog::TData&, so what's the problem?

Set the clip region during PrintPage().
0
 
LVL 4

Expert Comment

by:md041797
ID: 1167239
If my answer is insufficient, you should give me an F so your question will go back to the queue to be answered by others.
0
 

Author Comment

by:smeinert
ID: 1167240
New Prob

My problem has changed now. I know now how to set the margin, but I need the physical size of paper format what was chosen to print on. I got only the printable size. There is a variable TPrintDialog::TData::PaperSize but I don't understand this value (perhaps I need a key). The main fact is: I need the real paper size in mm, inch, pix or ... or ...so I can use it.

 Many thanks
       
         Swen
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now