Solved

Customizing OLE Stock Property Pages

Posted on 1997-01-21
1
268 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
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…

919 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

14 Experts available now in Live!

Get 1:1 Help Now