Solved

CFontDialog customisation

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

752 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