You must give every file filter a unique class identifier (CLSID), which identifies class objects to OLE. CLSIDs are universally unique identifiers (UUIDs), also called globally unique identifiers (GUIDs). You must include the CLSID for the file filter in your application and you must register it with the operating system when your application is installed.
If the file filter supports both importing and exporting, a unique CLSID must be associated with each file filter that is to be registered for the respective import and export registry setting.
The GUID Generator tool lets you generate a GUID that you can use to identify your file filter. A GUID Generator application, named Guidgen.exe, is provided with Microsoft Visual C++ development system. The GUID Generator calls the CoCreateGuid function to generate a new GUID. It also lets you copy the GUID to the clipboard so that you can insert the GUID into the source code for your application by using one of the following formats:
Defined in an IMPLEMENT_OLECREATE macro, which allows instances of a CCmdTarget-derived class to be created by Automation clients. For example:
// {CA761230-ED42-11CE-BACD-00AA0057B223}
IMPLEMENT_OLECREATE(<<class>>, <<external_name>>,
0xca761230, 0xed42, 0x11ce, 0xba, 0xcd, 0x0, 0xaa,
0x0, 0x57, 0xb2, 0x23);
Defined in an IMPLEMENT_OLECREATE macro, which is included with Visual C++ in the file Afxdisip.h. It allows instances of a CCmdTarget-derived class to be created by Automation clients. For example:
// {CA761230-ED42-11CE-BACD-00AA0057B223}
DEFINE_GUID(<<name>>,
0xca761230, 0xed42, 0x11ce, 0xba, 0xcd, 0x0, 0xaa, 0x0, 0x57, 0xb2,
0x23);
Declared as a statically allocated structure. For example:
// {CA761232-ED42-11CE-BACD-00AA0057B223}
static const GUID <<name>> = { 0xca761232, 0xed42, 0x11ce,
{ 0xba, 0xcd, 0x0, 0xaa, 0x0, 0x57, 0xb2, 0x23 } };
Specified in a form suitable for registry entries or registry editor scripts. For example:
{CA761233-ED42-11CE-BACD-00AA0057B223}