Solved

CFontDialog customisation

Posted on 1998-10-12
1
302 Views
Last Modified: 2013-11-20
I am trying to customise the CFontDialog as follows:

I have created a class which is derived from CFontDialog.  The m_cf structure is configured such that the Flags attribute has the CF_ENABLETEMPLATE set, the TemplateName attribute is set using MAKEINTRESOURCE( <resource ID> ) and the Instance handle is set to the return from GetAfxInstanceHandle().  The constructor for my derived class has parameters which exactly match those of the CFontDialog class and simply passes the parameters on.  The constructor then sets the attributes described above.  There is no other code for the derived class.

When the code is executed, instead of the expected dialog appearing, a Message Box appears saying 'There are no fonts loaded, open Control Panel to load fonts', and then the DoModal operation returns.

The ID for the child window's Group Box (the hole where the Common Dialog is to appear), is a bit suspicious as it was derived from an example for the CFileDialog, the example stated to use the specific ID of std32=0x045f, though the significance of this is not entirely clear.

Is there a different 'specific ID' which should be used for CFontDialog or should the m_cf structure be set up in a different way?
0
Comment
Question by:msrichardson
1 Comment
 

Accepted Solution

by:
sgreig earned 50 total points
ID: 1323202
You can import the existing Font dialog template from the font.dlg file.  Derive your own CFontDialog class and set the template to your imported template and then treat as you would any other dialog.
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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

707 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

13 Experts available now in Live!

Get 1:1 Help Now