Copyright: GUID Generator Component Help


GUID Generator Component - Overview

The GUID Generator component lets you generate globally unique identifiers, or GUIDs, that you can use to identify your ActiveX classes, objects, and interfaces. The GUID is copied to the Clipboard in one of four different formats for insertion into your application's source code.

GUID Generator Component - Specifics


GUID Generator Component - Specifics

The GUID Generator component calls the CoCreateGuid API function to generate a new GUID and lets you copy it to the Clipboard in one of four 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 using the DEFINE_GUID macro, which is commonly used in non-MFC programming. For example:

// {CA761231-ED42-11CE-BACD-00AA0057B223}

DEFINE_GUID(<<name>>, 0xca761231, 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}


GUID Generator Component - Create GUID Dialog

Use this dialog box to generate a new globally unique identifier, or GUID.

GUID Format

These buttons determine the format in which the GUID will be copied to the Clipboard.

1. IMPLEMENT_OLECREATE(...)   This format specifies the GUID in an IMPLEMENT_OLECREATE macro.

2. DEFINE_GUID(...)   This format specifies the GUID using the DEFINE_GUID macro.

3. static const struct GUID = {...}   This format declares the GUID as a static structure declaration.

4. Registry Format (i.e. {xxxxxxxx-xxxx...xxxx})   This format specifies the GUID in a form suitable for registry entries or registry editor scripts.

Result

This displays an example of the GUID format.

New GUID

Press this button to generate a new GUID.

Copy

Press this button to copy the GUID to the Clipboard using the selected format and dismiss the component. You can then paste the GUID code into your application's source code.