Share via


Generating a Class Identifier for the Filter (Windows Embedded CE 6.0)

1/6/2010

Each file filter must have a unique class identifier (CLSID), which identifies class objects to OLE. CLSIDs are globally unique identifiers (GUIDs). The file filter must be included in the application and registered with the operating system when the application is installed. If there are separate filters for importing and exporting, each must have its own CLSID.

The Guidgen.exe GUID generator is supplied with the Microsoft Visual C++ development system. Besides generating GUIDs, it can also copy the GUID to clipboard so the GUID can be accurately inserted into the application's source code, in one of the following formats:

  • IMPLEMENT_OLECREATE macro format
    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);
    
  • DEFINE_GUID macro format
    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);
    
  • Statically allocated structure format
    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 } };
    
  • Registry entry
    Specified in a form suitable for registry entries or registry editor scripts.

    {CA761233-ED42-11CE-BACD-00AA0057B223}
    

See Also

Concepts

Converting File Formats