This documentation is archived and is not being maintained.


Executes the specified custom registration script.

[ registration_script( 
) ]


The full path to a custom registration script (.rgs) file. A value of none, such as script = "none", indicates that the coclass has no registration requirements.

Attribute Context

Applies to class, struct
Repeatable No
Required attributes One or more of the following: coclass, progid, or vi_progid.
Invalid attributes None

For more information about the attribute contexts, see Attribute Contexts.


The registration_script C++ attribute executes the custom registration script specified by script. If this attribute is not specified, a standard .rgs file (containing information for registering the component) is used. For more information on .rgs files, see The ATL Registry Component (Registrar).

This attribute requires that the coclass, progid, or vi_progid attribute (or another attribute that implies one of these) also be applied to the same element.


The following code specifies that the component has a registry script called Myrgs.rgs.

// cpp_attr_ref_registration_script.cpp
// compile with: /LD
#include "atlbase.h"
#include "atlcom.h"

[module (name="REG")];

[object, uuid("d9cd196b-6836-470b-9b9b-5b04b828e5b0")]
__interface IFace

// requires "myregs.rgs"
// create sample .RGS file "myregs.rgs" if it does not exist
[ coclass, registration_script(script="cpp_attr_ref_registration_script.rgs"),
class CMyClass:public IFace

See Also

COM Attributes | Class Attributes | rdx | Attributes Samples