Solved

problems with TPrinter::Setup(TWindow* parent)

Posted on 1997-08-12
5
373 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 …
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
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.

724 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