Solved

problems with TPrinter::Setup(TWindow* parent)

Posted on 1997-08-12
5
369 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
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 viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

822 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