Solved

CFontDialog customisation

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Login Script to Copy Folders 12 42
repeateFront java challenge 31 94
Hibernate methods 2 77
VBA "SendKeys" Syntax for Multiple Keystrokes 7 117
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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…
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.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

821 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