The Structure of Registry Entries

The following Registry structure is required if QUIKVIEW is to associate a file's class identifier or extension with the class identifier of a file viewer. If you deviate from this structure, QUIKVIEW won't find your file viewer, and you'll be one frustrated developer.

HKEY_CLASSES_ROOT
\QuickView
\<extension> = <human-readable document type>
\{<CLSID>} = <human-readable viewer name>
\{<CLSID>} = <human-readable viewer name>
\{<CLSID>} = <human-readable viewer name>
§
[More extension entries for additional file types]
§

\CLSID
\{<CLSID>} = <human-readable viewer name>
\InprocServer32 = <full path to file viewer DLL>
\ThreadingModel = <Model>
§
[More class IDs for file viewers and other object servers]
§

How about some explanation?

Each CLSID stored under the file extension subkeys corresponds to an entry of that same CLSID stored under the top-level key, called (what else?) CLSID, the standard location for storing information about OLE objects. For file viewers, an InprocServer32 subkey is needed under the file viewer's class identifier key. The value of this subkey is the full path to the file viewer DLL. In my sample, the file viewer is stored in the \WINDOWS\SYSTEM\VIEWERS folder. InprocServer32 is a standard OLE subkey storing the path to an object. Using this subkey allows the QUIKVIEW program to use standard OLE APIs to access and create objects from file viewer servers.

An apartment-model-aware process must have thread-safe entry points because multiple apartments can call CoCreateInstance or CoGetClassOb-ject simultaneously. In practice, this means that your application should do the following:

When you create a file viewer using MFC, you can let MFC initialize for you, as I did in the MFCVIEW sample.