Click here to Skip to main content
15,895,809 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to store and retrieve data from database via internet using VC++2008 Pin
Erudite_Eric2-Aug-13 5:04
Erudite_Eric2-Aug-13 5:04 
GeneralRe: How to store and retrieve data from database via internet using VC++2008 Pin
NotPolitcallyCorrect2-Aug-13 5:27
NotPolitcallyCorrect2-Aug-13 5:27 
GeneralRe: How to store and retrieve data from database via internet using VC++2008 Pin
shanmugarajaa3-Aug-13 3:32
shanmugarajaa3-Aug-13 3:32 
GeneralRe: How to store and retrieve data from database via internet using VC++2008 Pin
Richard MacCutchan6-Aug-13 4:45
mveRichard MacCutchan6-Aug-13 4:45 
GeneralMessage Automatically Put Back Pin
Erudite_Eric6-Aug-13 4:33
Erudite_Eric6-Aug-13 4:33 
GeneralRe: How to store and retrieve data from database via internet using VC++2008 Pin
Rolf Kristensen3-Aug-13 1:01
Rolf Kristensen3-Aug-13 1:01 
AnswerRe: How to store and retrieve data from database via internet using VC++2008 Pin
jschell2-Aug-13 14:26
jschell2-Aug-13 14:26 
QuestionDevice context and dimensions Pin
Argonia1-Aug-13 4:54
professionalArgonia1-Aug-13 4:54 
Hello,
I came across something i don't understand one little bit, and i hope you can help me understand it.
The code is in the function OnDraw with parameter CDC* pDC and i have the following code
C++
rectPreviewClient.SetRect(0, 0, pDC->GetDeviceCaps(HORZRES), pDC->GetDeviceCaps(VERTRES));
...
CDC dc;
dc.Attach(pDC->GetSafeHdc());

And the CRect rectPreviewClientis given to a function which draws some stuff.
The map mode isn't changed and it remains MM_ANISOTROPIC even until the drawing of the elements.

The thing i don't understand is how come i can print stuff for example
C++
dc.TextOut(0, rectPreviewClient.bottom - tm.tmHeight,....)
//tm is from type TEXTMETRIC taken with GetTextMetrics() from dc
when its clear the both CDC members have different dimensions.

The dpi's are different pDC have 600 dpi and dc has 96.

If i use GetDeviceCaps(HORZRES) and GetDeviceCaps(VERTRES)on dc i get smaller numbers and yet i can print stuff with a lot higher coordinates.

Note: The dc is used for PrintPreview. Currently i am trying to change the font size and i need to change the map mode to MM_TEXT but when i call TextOut with the coordinates normally used the text is drown outside the CDC. If the MM_TEXT is removed the text is shown but too small

Edit: I fixed the Font size without changing the map mode with CreatePointFont and height of the Font size but the question remains How can i use coordinates from one CDC to another with different dpi and dimensions.

Any help will be appreciated. Thank you in advance.
Microsoft ... the only place where VARIANT_TRUE != true


modified 2-Aug-13 9:22am.

QuestionHooking a running process 's Innermost dll's function Pin
dileep Perumbavoor1-Aug-13 1:26
dileep Perumbavoor1-Aug-13 1:26 
AnswerRe: Hooking a running process 's Innermost dll's function Pin
Erudite_Eric1-Aug-13 1:34
Erudite_Eric1-Aug-13 1:34 
AnswerRe: Hooking a running process 's Innermost dll's function Pin
pasztorpisti1-Aug-13 1:40
pasztorpisti1-Aug-13 1:40 
AnswerRe: Hooking a running process 's Innermost dll's function Pin
Santhosh G_3-Aug-13 23:30
Santhosh G_3-Aug-13 23:30 
QuestionSaving console output to .txt/.html file using C++/VC++ Pin
pk jain31-Jul-13 3:30
pk jain31-Jul-13 3:30 
AnswerRe: Saving console output to .txt/.html file using C++/VC++ Pin
Richard MacCutchan31-Jul-13 3:58
mveRichard MacCutchan31-Jul-13 3:58 
AnswerRe: Saving console output to .txt/.html file using C++/VC++ Pin
pasztorpisti31-Jul-13 4:25
pasztorpisti31-Jul-13 4:25 
QuestionCString to float conversion Pin
tagopi31-Jul-13 0:32
tagopi31-Jul-13 0:32 
AnswerRe: CString to float conversion Pin
pasztorpisti31-Jul-13 0:49
pasztorpisti31-Jul-13 0:49 
QuestionCan we Directly write a Class Object with vectors as member into FILE ? Pin
002comp31-Jul-13 0:26
002comp31-Jul-13 0:26 
AnswerRe: Can we Directly write a Class Object with vectors as member into FILE ? Pin
pasztorpisti31-Jul-13 0:38
pasztorpisti31-Jul-13 0:38 
GeneralRe: Can we Directly write a Class Object with vectors as member into FILE ? Pin
002comp31-Jul-13 1:34
002comp31-Jul-13 1:34 
GeneralRe: Can we Directly write a Class Object with vectors as member into FILE ? Pin
pasztorpisti31-Jul-13 1:50
pasztorpisti31-Jul-13 1:50 
GeneralRe: Can we Directly write a Class Object with vectors as member into FILE ? Pin
002comp31-Jul-13 2:23
002comp31-Jul-13 2:23 
GeneralRe: Can we Directly write a Class Object with vectors as member into FILE ? Pin
pasztorpisti31-Jul-13 4:03
pasztorpisti31-Jul-13 4:03 
GeneralRe: Can we Directly write a Class Object with vectors as member into FILE ? Pin
002comp31-Jul-13 18:11
002comp31-Jul-13 18:11 
GeneralRe: Can we Directly write a Class Object with vectors as member into FILE ? Pin
pasztorpisti31-Jul-13 22:37
pasztorpisti31-Jul-13 22:37 

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.