Solved

CFontDialog customisation

Posted on 1998-10-12
1
323 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
[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
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

627 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