Solved

Setting size of ole font in ActiveX control

Posted on 1997-07-17
4
1,055 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
font missing in acrobat 3 77
crystal report check box and wingdings font 7 241
matchUp  challenge 6 76
Printout, or copy to a file,  thumbnails of ALL available fonts 5 90
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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…

740 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