Nully
April 5th, 1999, 12:34 AM
I need a way to convert a size in MM_HIMETRIC units to MM_TEXT units.
It's bound to happen. You create a program using one mapping mode and lo and behold you end up needing to use a size measured in a different mapping mode (usually because you want to use code provided by someone else like a COM object).
Microsoft to my knowledge provides no API conversion functions for converting from one mapping mode to another. I don't understand why.
I have an ATL program that uses IPicture. IPicture has functions to obtain the width and height of the picture in MM_HIMETRIC units. My program uses MM_TEXT. Bounding rects are given to me in MM_TEXT. Neither IPicture, nor the ATL framework will return compatible coordinates and sizes.
This is frustrating and discouraging.
Is their way to convert a size in MM_HIMETRIC units to MM_TEXT units? Is it just me or are Microsoft developers really mad?
"Windows-based programming is strange. It's weird, it's warped, it's awkward, it's convoluted, it's mind-boggling. It's definitely not immediately obvious, and it may take some time before you experience the thrill of shouting "Eureka!" - Charles Petzold, highly aclaimed author of windows books.
It's bound to happen. You create a program using one mapping mode and lo and behold you end up needing to use a size measured in a different mapping mode (usually because you want to use code provided by someone else like a COM object).
Microsoft to my knowledge provides no API conversion functions for converting from one mapping mode to another. I don't understand why.
I have an ATL program that uses IPicture. IPicture has functions to obtain the width and height of the picture in MM_HIMETRIC units. My program uses MM_TEXT. Bounding rects are given to me in MM_TEXT. Neither IPicture, nor the ATL framework will return compatible coordinates and sizes.
This is frustrating and discouraging.
Is their way to convert a size in MM_HIMETRIC units to MM_TEXT units? Is it just me or are Microsoft developers really mad?
"Windows-based programming is strange. It's weird, it's warped, it's awkward, it's convoluted, it's mind-boggling. It's definitely not immediately obvious, and it may take some time before you experience the thrill of shouting "Eureka!" - Charles Petzold, highly aclaimed author of windows books.