Compartilhar via


CLSID Registry Key (Compact 2013)

3/26/2014

To register COM class objects that represent your custom components, modules, or applications, create the following registry key under the registry key HKEY_CLASSES_ROOT\CLSID.

Name

Type

Description

The CLSID for the COM class object.

For information about obtaining a CLSID for your application, see CoCreateGuid.

REG_SZ

Set to a human readable name for the COM object that can be displayed in the user interface.

The following table shows the entries you can create in the key HKEY_CLASSES_ROOT\CLSID\{<CLSID>}.

Name

Type

Description

AppID

REG_SZ (CLSID)

[Optional] Set to an application identifier (AppID) GUID that represents the program in which the COM object runs. You can assign the same AppID value to multiple COM objects defined in the registry.

AutoConvertTo

REG_SZ (CLSID)

[Optional] Set to the class identifier of the object to which a given object or class of objects will be converted. You typically use this key to automatically convert files created by an older version of an application to a newer version of the application.

AutoTreatAs

REG_SZ (CLSID)

[Optional] Set to the CLSID that is automatically assigned to the TreatAs entry.

Control

None

[Optional] Create this valueless entry to identify an object as an ActiveX control that you want to be able to use in COM containers.

If you do not create the entry, then the control works only with a single COM container and not with other COM containers.

DefaultIcon

REG_SZ

[Optional] Set to the full path of the object application, followed by a comma, followed by the resource index of the icon within the executable, for example, c:\samp\isvrotl.exe,0

InprocHandler32

REG_SZ

Set to one of the following in-process handlers:

  • OLE32.DLL for the default handler
  • DLL name of your custom handler

You must set one of the following registry entries: InprocHandler32, InProcServer32, or LocalServer32.

InprocServer32

REG_SZ

Set to the path to the file for 32-bit in-process server, a DLL that runs in the same process as the caller.

When you create this entry, you must also create a ThreadingModel sub-entry.

You must set one of the following registry entries: InprocHandler32, InProcServer32, or LocalServer32.

LocalServer32

REG_SZ

Set to the name of the 32-bit local server application, including command-line arguments:

This entry is required for 32-bit local servers.

You must set one of the following registry entries: InprocHandler32, InProcServer32, or LocalServer32.

ProgID

REG_SZ

[Optional] Set to the programmatic identifier for a class, in the format <vendor>.<component>.<version>, for example, "myFeature.myControl.1.0."

You must create this entry for insertable object classes.

TreatAs

REG_SZ

[Optional] Set to the CLSID of a class that can emulate the current class.

Version

REG_SZ

[Optional] Set to the version number of the control, which must match the version of the type library associated with the control.

If you specify a 32-bit in-process server (InprocServer32), you must set a threading model by using the following registry entry in the key HKEY_CLASSES_ROOT\CLSID\{<CLSID>}\InprocServer32.

Name

Type

Description

ThreadingModel

REG_SZ

[Optional] Specifies the threading model of the apartment the server runs in. Set to one of the following:

  • Apartment for single-threaded apartment.
  • Both for single-threaded or multithreaded apartment.
  • Free for multithreaded apartment.
  • Neutral for neutral apartment

If you don't create this entry or if you leave the value blank, the server is loaded into the first apartment that was initialized in the process.

If the COM object supports interfaces, you must create a separate registry key and registry entry for each IID in the key HKEY_CLASSES_ROOT\CLSID\{<CLSID>}\Interface.

Name

Type

Description

An interface identifier

REG_SZ

Set to the name of the interface, for example, "IMessageFilter".

You can register the verbs available for a COM object by creating a separate registry key and registry entry for each verb in the key HKEY_CLASSES_ROOT\CLSID\{<CLSID>}\Verb.

Name

Type

Description

An index number

REG_SZ

Specify a value for the verb action string that describes a suppported action. For example, "open" or "edit."

For more information, see IOleObject::DoVerb.

See Also

Reference

COM and DCOM Registry Settings