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