Solved

Customizing OLE Stock Property Pages

Posted on 1997-01-21
1
269 Views
Last Modified: 2013-11-25
How do I customize the stock property pages in an ocx? Specifically, how do I make the stock font property page display fixed pitch fonts only?

Thanks for any help,
Rondal
0
Comment
Question by:rondal
1 Comment
 

Accepted Solution

by:
nkothari earned 200 total points
ID: 1300044
MFC's COleFontPropPage is defined in ctlimpl.h and implemented in PpgFont.cpp.

Derive your property page from COleFontPropPage, and all you need to do is override

COleFontPropPage::EnumFontFamiliesCallBack
This function is called once for each font when Windows returns info about existing fonts.  It calls an AddFont method.
What you need to do is test the attributes of the font in question and determine if you'd like the font property page to show it in its combo box.

CFontPropPage will handle all the rest (size choices, bold/italic etc. and even user selection)

So all you need to do basically is impose a filter in between by overriding the method above.
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

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 …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

803 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