Solved

Setting size of ole font in ActiveX control

Posted on 1997-07-17
4
1,038 Views
Last Modified: 2013-12-02
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.
0
Comment
Question by:galkin
  • 2
4 Comments
 
LVL 4

Expert Comment

by:mbhakta
ID: 1302619
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....
0
 
LVL 8

Expert Comment

by:gelbert
ID: 1302620
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.
0
 
LVL 7

Author Comment

by:galkin
ID: 1302621
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.
0
 
LVL 8

Accepted Solution

by:
gelbert earned 50 total points
ID: 1302622
Here is sample:

static const FONTDESC _fontdescHeading =
  { sizeof(FONTDESC), OLESTR("MS Sans Serif"), FONTSIZE( 12 ), FW_BOLD,
     ANSI_CHARSET, FALSE, FALSE, FALSE };

it is from the artical "OLE Controls: Using Fonts in an OLE Control" from MSDN.

If you want to use IDispatch based interface then you will have to multiply font size value by 10000.

 

0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Tab names are off by one 5 49
string initialization in java 11 103
Font: I need Lato on my Mac 10 118
Sed question 2 49
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now