Click here to Skip to main content
16,011,988 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: Cannot get CDialogResize to work Pin
Defenestration3-May-06 6:19
Defenestration3-May-06 6:19 
QuestionCompiler error Pin
HarishDixit2-May-06 6:56
HarishDixit2-May-06 6:56 
AnswerRe: Compiler error Pin
toxcct2-May-06 7:22
toxcct2-May-06 7:22 
GeneralRe: Compiler error Pin
HarishDixit2-May-06 7:35
HarishDixit2-May-06 7:35 
AnswerRe: Compiler error Pin
Stephen Hewitt2-May-06 15:05
Stephen Hewitt2-May-06 15:05 
AnswerRe: Compiler error Pin
Stephen Hewitt2-May-06 15:40
Stephen Hewitt2-May-06 15:40 
Questioncalculeting line per page for printing Pin
Antonov A.V.2-May-06 5:00
Antonov A.V.2-May-06 5:00 
AnswerRe: calculeting line per page for printing Pin
Steve S10-May-06 2:35
Steve S10-May-06 2:35 
First, you need a printer DC, which you can then use with GetDeviceCaps to determine (approximate) page size. From there, you select in the font you want to use. Then use GetTextMetrics to fill in a TEXTMETRIC, (specifically for tm.tmHeight) and then divide the page height by the line height. This will give you nLines, although you might want to adjust for your own margins etc.

Many moons ago I produced a series of "Print Object" classes, each of which represented some kind of output, and was capable of measuring and rendering to a DC based on their content, so I could do things like create a text print object with a specified width (in logical units), and it would then tell me how tall it needed to be (including any line wraps etc).

For things like print/print preview this is quite useful, as I could generate a complete set representing the data in my apps. In that way, knowing the number of pages and the exact layout becomes much simpler, even for relatively complex documents. I used it as the print-engine component for a series of billing applications, for instance.

Steve S
Developer for hire
Question, if user clicks Capture web page button click event Pin
HarishDixit1-May-06 5:35
HarishDixit1-May-06 5:35 
QuestionWTL MDI can't add menu bar in child window Pin
Loopzilla1-May-06 3:07
Loopzilla1-May-06 3:07 
Questionhow to convert unix timestamp to date Pin
proteushf29-Apr-06 22:20
proteushf29-Apr-06 22:20 
AnswerRe: how to convert unix timestamp to date Pin
Stuart Dootson30-Apr-06 1:16
professionalStuart Dootson30-Apr-06 1:16 
GeneralRe: how to convert unix timestamp to date Pin
proteushf30-Apr-06 3:28
proteushf30-Apr-06 3:28 
QuestionATL property problem Pin
Radu Sorin27-Apr-06 23:08
Radu Sorin27-Apr-06 23:08 
AnswerRe: ATL property problem Pin
Kurt _B28-Apr-06 5:25
Kurt _B28-Apr-06 5:25 
QuestionSTL allocators in shared memory Pin
psbasha27-Apr-06 4:07
psbasha27-Apr-06 4:07 
AnswerRe: STL allocators in shared memory Pin
Nemanja Trifunovic27-Apr-06 4:19
Nemanja Trifunovic27-Apr-06 4:19 
AnswerRe: STL allocators in shared memory Pin
Stephen Hewitt27-Apr-06 20:06
Stephen Hewitt27-Apr-06 20:06 
QuestionUsing CString in ATL Service Pin
MasthanRao27-Apr-06 3:21
MasthanRao27-Apr-06 3:21 
AnswerRe: Using CString in ATL Service Pin
RChin27-Apr-06 23:53
RChin27-Apr-06 23:53 
GeneralRe: Using CString in ATL Service Pin
MasthanRao28-Apr-06 1:05
MasthanRao28-Apr-06 1:05 
QuestionATL Exe Pin
Anthony988726-Apr-06 12:33
Anthony988726-Apr-06 12:33 
AnswerRe: ATL Exe Pin
Stephen Hewitt26-Apr-06 13:37
Stephen Hewitt26-Apr-06 13:37 
GeneralRe: ATL Exe Pin
Anthony988727-Apr-06 3:26
Anthony988727-Apr-06 3:26 
GeneralRe: ATL Exe Pin
Stephen Hewitt27-Apr-06 13:48
Stephen Hewitt27-Apr-06 13:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.