Click here to Skip to main content
15,913,083 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Font size Pin
CPallini31-May-07 0:47
mveCPallini31-May-07 0:47 
GeneralRe: Font size Pin
garfield18531-May-07 0:51
garfield18531-May-07 0:51 
GeneralRe: Font size Pin
Hamid_RT31-May-07 1:32
Hamid_RT31-May-07 1:32 
GeneralRe: Font size Pin
garfield18531-May-07 1:36
garfield18531-May-07 1:36 
GeneralRe: Font size Pin
CPallini31-May-07 1:49
mveCPallini31-May-07 1:49 
GeneralRe: Font size Pin
CPallini31-May-07 1:43
mveCPallini31-May-07 1:43 
GeneralRe: Font size Pin
garfield18531-May-07 3:22
garfield18531-May-07 3:22 
GeneralRe: Font size Pin
CPallini31-May-07 3:43
mveCPallini31-May-07 3:43 
hDC must be a valid handle of a device context (HDC).
Using MFC you can pass the HDC of the current window (provided the code belongs to a window class)

nHeight = -MulDiv(20, GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSY), 72);


you can also use the screen HDC for the pourpose:
nHeight = -MulDiv(20, GetDeviceCaps(::GetDC(NULL), LOGPIXELSY), 72);



garfield185 wrote:
I guess LOGPIXELSY is a constant that I must define


No you must NOT define it, since it is already defined inside windows.h header file.

Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

GeneralRe: Font size Pin
garfield18531-May-07 4:00
garfield18531-May-07 4:00 
GeneralRe: Font size Pin
CPallini31-May-07 5:11
mveCPallini31-May-07 5:11 
GeneralRe: Font size Pin
garfield18531-May-07 5:25
garfield18531-May-07 5:25 
GeneralRe: Font size Pin
David Crow31-May-07 4:12
David Crow31-May-07 4:12 
GeneralRe: Font size Pin
garfield18531-May-07 4:31
garfield18531-May-07 4:31 
QuestionCreating .h files using MATLAB Pin
Purushottama31-May-07 0:31
Purushottama31-May-07 0:31 
AnswerRe: Creating .h files using MATLAB Pin
Cedric Moonen31-May-07 1:31
Cedric Moonen31-May-07 1:31 
JokeRe: Creating .h files using MATLAB Pin
CPallini31-May-07 2:10
mveCPallini31-May-07 2:10 
QuestionMSVCRT.dll and _resetstkoflw() Win 2000 and XP Pin
jerome_data31-May-07 0:27
jerome_data31-May-07 0:27 
AnswerRe: MSVCRT.dll and _resetstkoflw() Win 2000 and XP Pin
Matthew Faithfull31-May-07 0:46
Matthew Faithfull31-May-07 0:46 
AnswerRe: MSVCRT.dll and _resetstkoflw() Win 2000 and XP Pin
David Crow31-May-07 4:15
David Crow31-May-07 4:15 
AnswerRe: MSVCRT.dll and _resetstkoflw() Win 2000 and XP Pin
Stephen Hewitt31-May-07 14:41
Stephen Hewitt31-May-07 14:41 
QuestionInsert a dialog inside SDI(Pls reply me) Pin
TobetheWinner31-May-07 0:23
TobetheWinner31-May-07 0:23 
AnswerRe: Insert a dialog inside SDI(Pls reply me) Pin
Roger Stoltz31-May-07 1:10
Roger Stoltz31-May-07 1:10 
AnswerRe: Insert a dialog inside SDI(Pls reply me) Pin
Rajkumar R31-May-07 2:37
Rajkumar R31-May-07 2:37 
AnswerRe: Insert a dialog inside SDI(Pls reply me) Pin
Hamid_RT31-May-07 20:20
Hamid_RT31-May-07 20:20 
QuestionHiding values in a combobox depending on the changes in another combobox value Pin
aby Skaria31-May-07 0:17
aby Skaria31-May-07 0:17 

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.