Click here to Skip to main content
15,910,981 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralYou are welcome Pin
CPallini4-Oct-08 0:59
mveCPallini4-Oct-08 0:59 
GeneralRe: CString Array To LPCSTR Pin
David Crow4-Oct-08 3:31
David Crow4-Oct-08 3:31 
QuestionVSS2005 sync problem Pin
followait3-Oct-08 14:38
followait3-Oct-08 14:38 
QuestionWindows system startup applications... Pin
TURK3-Oct-08 11:33
TURK3-Oct-08 11:33 
QuestionRe: Windows system startup applications... Pin
David Crow3-Oct-08 14:53
David Crow3-Oct-08 14:53 
AnswerRe: Windows system startup applications... Pin
cofi++5-Oct-08 7:46
cofi++5-Oct-08 7:46 
GeneralRe: Windows system startup applications... Pin
TURK16-Jul-09 14:44
TURK16-Jul-09 14:44 
QuestionCFontDialog font size - Need Help!!!!! Pin
Lonnie Johnson3-Oct-08 10:46
Lonnie Johnson3-Oct-08 10:46 
In the OnBeginPrinting function of my view class I am displaying a CFontDialog dialog box. I want the default font to be Arial and the default size to be 8. When the dialog box displays, it a shows default size of 50.

Here is the code. These are the first lines in the OnBeginPrinting function.

ASSERT(pDC->GetMapMode() == MM_TEXT);
LOGFONT  lf;
::ZeroMemory(&lf, sizeof(LOGFONT));
lf.lfHeight = -MulDiv(10, pDC->GetDeviceCaps(LOGPIXELSY), 72);
lstrcpy(lf.lfFaceName, _T("Arial"));    
CFontDialog dlg(&lf, CF_PRINTERFONTS, pDC);
if (dlg.DoModal() == IDOK)
{
    m_strFont = dlg.GetFaceName();
    m_nPointSize = dlg.GetSize() / 10;
}


The value returned by pDC->GetDeviceCaps(LOGPIXELSY) is 600.
The computed value for lf.lfHeight when 8 points is used is -67.
The resulting size value in the Select Font dialog is 50.

Why is the Select Font dialog displaying as font size of 50 instead of 8?

Here are the results from some other point sizes.

input dialog box
8 50
10 62
12 75
14 88
20 125

Every example of code I can find looks just like the above. Why is this code not working?

Thanks!
QuestionRe: CFontDialog font size - Need Help!!!!! Pin
CPallini3-Oct-08 12:14
mveCPallini3-Oct-08 12:14 
AnswerRe: CFontDialog font size - Need Help!!!!! Pin
Lonnie Johnson6-Oct-08 8:43
Lonnie Johnson6-Oct-08 8:43 
QuestionGUI Pin
Sarriss3-Oct-08 3:59
Sarriss3-Oct-08 3:59 
AnswerRe: GUI Pin
Mark Salsbery3-Oct-08 4:47
Mark Salsbery3-Oct-08 4:47 
GeneralRe: GUI Pin
Sarriss3-Oct-08 4:53
Sarriss3-Oct-08 4:53 
GeneralRe: GUI Pin
led mike3-Oct-08 5:59
led mike3-Oct-08 5:59 
GeneralRe: GUI Pin
Mark Salsbery3-Oct-08 6:12
Mark Salsbery3-Oct-08 6:12 
GeneralRe: GUI Pin
Sarriss3-Oct-08 6:33
Sarriss3-Oct-08 6:33 
GeneralRe: GUI Pin
Mark Salsbery3-Oct-08 6:57
Mark Salsbery3-Oct-08 6:57 
QuestionFailed to retrieve process arguments in 64 bit Windows Pin
Jack Rong3-Oct-08 3:59
Jack Rong3-Oct-08 3:59 
QuestionHow to get windows driver kit Pin
Deepu Antony3-Oct-08 3:05
Deepu Antony3-Oct-08 3:05 
AnswerRe: How to get windows driver kit Pin
Matthew Faithfull3-Oct-08 3:11
Matthew Faithfull3-Oct-08 3:11 
GeneralRe: How to get windows driver kit Pin
Deepu Antony3-Oct-08 3:26
Deepu Antony3-Oct-08 3:26 
AnswerRe: How to get windows driver kit Pin
Matthew Faithfull3-Oct-08 3:31
Matthew Faithfull3-Oct-08 3:31 
GeneralRe: How to get windows driver kit Pin
Deepu Antony3-Oct-08 3:39
Deepu Antony3-Oct-08 3:39 
GeneralRe: How to get windows driver kit Pin
Matthew Faithfull3-Oct-08 3:47
Matthew Faithfull3-Oct-08 3:47 
GeneralRe: How to get windows driver kit Pin
Deepu Antony3-Oct-08 3:54
Deepu Antony3-Oct-08 3:54 

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.