Class element
COM Class registration for parent Component.
Attributes
Advertise
yesnoSet this value to “yes” in order to create a normal Class table row. Set this value to “no” in order to generate Registry rows that perform similar registration (without the often problematic Windows Installer advertising behavior).
AppId
GuidThis attribute is only allowed when a Class is advertised. Using this attribute will reference an Application ID containing DCOM information for the associated application GUID. The value must correspond to an AppId/@Id of an AppId element nested under a Fragment, Module, or Package element. To associate an AppId with a non-advertised class, nest the class within a parent AppId element.
Argument
stringThis column is optional only when the Context column is set to “LocalServer” or “LocalServer32” server context. The text is registered as the argument against the OLE server and is used by OLE for invoking the server. Note that the resolution of properties in the Argument field is limited. A property formatted as [Property] in this field can only be resolved if the property already has the intended value when the component owning the class is installed. For example, for the argument ”[#MyDoc.doc]” to resolve to the correct value, the same process must be installing the file MyDoc.doc and the component that owns the class.
Context
The server context(s) for this COM server. This attribute is optional for VB6 libraries that are marked “PublicNotCreateable”. Class elements marked Advertised must specify at least one server context. It is most common for there to be a single value for the Context attribute.
Control
yesnoSet this attribute’s value to ‘yes’ to identify an object as an ActiveX Control. The default value is ‘no’.
Description
stringLocalized description associated with the Class ID and Program ID.
ForeignServer
stringMay only be specified if the value of the Advertise attribute is “no” and Server has not been specified. In addition, it may only be used when the Class element is directly under the Component element. The value can be that of an registry type (REG_SZ). This attribute should be used to specify foreign servers, such as mscoree.dll if needed.
Handler
stringThe default inproc handler. May be optionally provided only for Context = LocalServer or LocalServer32. Value of “1” creates a 16-bit InprocHandler (appearing as the InprocHandler value). Value of “2” creates a 32-bit InprocHandler (appearing as the InprocHandler32 value). Value of “3” creates 16-bit as well as 32-bit InprocHandlers. A non-numeric value is treated as a system file that serves as the 32-bit InprocHandler (appearing as the InprocHandler32 value).
Icon
stringThe file providing the icon associated with this CLSID. Reference to an Icon element (should match the Id attribute of an Icon element). This is currently not supported if the value of the Advertise attribute is “no”.
IconIndex
IntegerIcon index into the icon file.
Id
Guid requiredThe Class identifier (CLSID) of a COM server.
Insertable
yesnoSpecifies the CLSID may be insertable.
Programmable
yesnoSpecifies the CLSID may be programmable.
RelativePath
yesnoWhen the value is “yes”, the bare file name can be used for COM servers. The installer registers the file name only instead of the complete path. This enables the server in the current directory to take precedence and allows multiple copies of the same component.
SafeForInitializing
yesnoMay only be specified if the value of the Advertise attribute is “no”.
SafeForScripting
yesnoMay only be specified if the value of the Advertise attribute is “no”.
Server
stringMay only be specified if the value of the Advertise attribute is “no” and the ForeignServer attribute is not specified. File Id of the COM server file. If this element is nested under a File element, this value defaults to the value of the parent File/@Id.
ShortPath
yesnoSpecifies whether or not to use the short path for the COM server. This can only apply when Advertise is set to ‘no’. The default is ‘no’ meaning that it will use the long file name for the COM server.
ThreadingModel
Threading model for the CLSID. This attribute’s value must be one of the following:
- apartment
- free
- both
- neutral
- single
- rental
Version
stringVersion for the CLSID.
Children
- ProgId
- A ProgId associated with Class must be a child element of the Class element
Parents
Remarks
When being used in unadvertised mode, the attributes in the Class element correspond to registry
values under the [HKCR\CLSID\\\{Id}]
and [HKCR\CLSID\\\{Id}\Context]
keys as follows:
Id, Context
: [HKCR\CLSID\{Id}\Context]Server
: [HKCR\CLSID\{01234567-89AB-CDEF-0123-456789ABCDEF}\LocalServer32]@=”[!comserv.dll]”ForeignServer
: [HKCR\CLSID\{01234567-89AB-CDEF-0123-456789ABCDEF}\LocalServer32]@=“mscoree.dll”AppId
: [HKCR\CLSID\{01234567-89AB-CDEF-0123-456789ABCDEF}]\AppId=“{00000000-89AB-0000-0123-000000000000}”Argument
: [HKCR\CLSID\{01234567-89AB-CDEF-0123-456789ABCDEF}\LocalServer32]@=”[!comserv.dll] /arg1 /arg2 /arg3”Control
: [HKCR\CLSID\{01234567-89AB-CDEF-0123-456789ABCDEF}\Control]Description
: [HKCR\CLSID\{01234567-89AB-CDEF-0123-456789ABCDEF}]@=“Description of Example COM Component”Handler
: [HKCR\CLSID\{01234567-89AB-CDEF-0123-456789ABCDEF}\InprocHandler32]@=“handler.dll”Insertable
: [HKCR\CLSID\{01234567-89AB-CDEF-0123-456789ABCDEF}\Insertable]Insertable
: [HKCR\CLSID\{01234567-89AB-CDEF-0123-456789ABCDEF}\NotInsertable]Programmable
: [HKCR\CLSID\{01234567-89AB-CDEF-0123-456789ABCDEF}\Programmable]SafeForInitializing
: [HKCR\CLSID\{01234567-89AB-CDEF-0123-456789ABCDEF}\Implemented Categories\{7DD95801-9882-11CF-9FA9-00AA006C42C4}]ThreadingModel
: [HKCR\CLSID\{01234567-89AB-CDEF-0123-456789ABCDEF}\LocalServer32]\ThreadingModel=“Apartment”TypeLibId
: [HKCR\CLSID\{01234567-89AB-CDEF-0123-456789ABCDEF}\TypeLib]@=“{11111111-89AB-1111-0123-111111111111}”Version
: [HKCR\CLSID\{01234567-89AB-CDEF-0123-456789ABCDEF}\Version]@=“1.0.0.0”