Registering the Application

Registration maps the ProgID of the application to a unique CLSID, so that you can create instances of the application by name, rather than by CLSID. For example, registering Microsoft Excel associates a CLSID with the ProgID Excel.Application.

In Visual Basic, you use the ProgID to create an instance of the application as follows:

SET xl = CreateObject("Excel.Application")

By passing the ProgID to CLSIDFromProgID, you can get the corresponding CLSID for use in CoCreateInstance. Only applications that will be used in this way need to be registered.

The registration file uses the following syntax for the application:

\ AppName.ObjectName[.VersionNumber] = human_readable_string
\ AppName.ObjectName\CLSID = {UUID}

Parameters

AppName

The name of the application.

ObjectName

The name of the object to be registered (in this case, Application).

VersionNumber

The optional version number of the object.

human_readable_string

A string that describes the application to users. The recommended maximum length is 40 characters.

UUID

The universally unique identifier for the application CLSID. To generate a UUID for your class, run the utility Guidgen.exe.