Compiler: Mingw(whatever comes with dev-c++ 5 beta)
Other: Windows Api
Can anyone tell me the correct way to convert logical units for a device context to the equivalent units for "GetDeviceCaps(PrnHdl, HORZRES)" is?
Basically I have this program(alternate version)(Needs to be downloaded as a .midi and renamed to a .zip), file "09_print.cpp" function "PrintAddress", I was updating for the tumble weed and came across a problem, "GetTextExtentPoint32" and "DrawText with DT_CALCRECT" return Logical units where I need the equivalent to "GetDeviceCaps(PrnHdl, HORZRES)" units.
I'm using "CalcRect.right * (GetDeviceCaps(PrnHdl, LOGPIXELSX) / GetDeviceCaps(PrnHdl, HORZSIZE) +1 )" where "CalcRect.right" is the output from "DrawText" with "DT_CALCRECT"(the same number is output from "GetTextExtentPoint32").
Is this the correct way to convert?
I tried "DPtoLP" and "LPtoDP" but got the exact same number out that I put in.
I'm going away sometime on Saturday (gmt+10) and may never come back, if you reply and I don't answer please forgive me, it means I'm gone. I will give a notification post before I go.......