Solved

problems with TPrinter::Setup(TWindow* parent)

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Rijndael string encryption in C++ 3 93
Dynamically allocate memory 9 47
C++ question 3 46
Safe conversion? 4 19
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

759 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

23 Experts available now in Live!

Get 1:1 Help Now