Article ID: 160909 - Last Review: November 18, 2003 - Revision: 2.0 FIX: Binder95 Does Not Show an MFC DocObject Server IconThis article was previously published under Q160909 On This PageSYMPTOMS
Starting with Visual C++ 4.2, MFC provides support for creating
Document Object (DocObject) Servers. The Binder application that comes
with Microsoft Office '95 is a DocObject container. When you insert a
DocObject server created by Visual C++ into the Binder, the defined icon
for the document may not show up as expected.
CAUSE
The Binder application that comes with Microsoft Office '95 searches the
registry for the CLSID of the DocObject server looking for the
DefaultExtension key. It expects a certain format for this key to
successfully display the correct icon. The MFC
COleTemplateServer::UpdateRegistry() function does not register the
information in this format.
RESOLUTION
The resolution involves changing the DefaultExtension key to the format
that Binder expects after UpdateRegistry() is called. The sample code below
demonstrates how this can be done. The code that accomplishes this is
copied almost verbatim from the source code of
COleTemplateServer::UpdateRegistry().
STATUS
This problem was corrected in Visual C++ version 6.0 for Windows
MORE INFORMATION
The following shows the difference between the DefaultExtension keys of an
Office '95 application and an AppWizard generated application:
Excel Worksheet:
If you change the DefaultExtension key of the AppWizard app to read as
follows
Sample CodeAPPLIES TO
| Article Translations
|

Back to the top
