Link to home
Start Free TrialLog in
Avatar of galkin
galkin

asked on

Setting size of ole font in ActiveX control

How to set size of ole font in ActiveX control. When ActiveX control is
inserted in the project ole font wrapper class( COleFont) is created
and it has method SetSize which takes argument size of type OLE currency. I
don't understand what type it is. There is a macro FONTSIZE which converts
from font height to CY but if I provider for instance 8 as a height a get
bold font which is greater then 8.
Please explain to me how to use it and programmatically set size of the
font in ActiveX control.
Thanks.
Avatar of mbhakta
mbhakta

There is a pretty good book called Active X inside out by Adam Denning from MS Press. There are about 200 pages dedicated to fonts on Active X controls and a pretty lucid explaination on the same. Check it out....
You should use IFontDispatch interface to set font size. There is a good artical about how to set font size in VC++ 5.0 help called "ActiveX Controls: Using Fonts in an ActiveX Control". If you can not find it let me know and I can email it to you.
Avatar of galkin

ASKER

IFontDispatch is IDispattch interface allowing set font size ONLY through SetSize font of COleFont wrapper class. This function takes one parameter namelyCOleCurrency. The question is how to properly convert fon size in pixels in OLE currency value. I have not found yet better solution.
ASKER CERTIFIED SOLUTION
Avatar of gelbert
gelbert

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial