COM Identifiers

The underlying mechanism by which instances of a Public class are created and accessed is known as COM – the Component Object Model. (The terms COM and ActiveX have become more or less interchangeable). In order to create a COM object, a unique identifier is needed, since the code behind this object may have been created and compiled on one machine, and may now be running on another, and there must be some means of uniquely identifying the code to be accessed. There are two main types of COM identifier concepts which are of concern to users of the A-Shell ActiveX SDK.  These are the ClassID and the ProgID.

The ClassID is the unique identifier (sometimes called a GUID or Global Unique Identifier) which is assigned automatically when a new class is developed, and is designed to be globally unique – i.e. no two classes developed by different users anywhere in the World will ever be given the same ClassID. A ClassID is hexadecimal in nature, and of a form similar to the following:

C43D9AFE-A88C-4C53-BDF4-DD038E4D7132

Visual Basic developers do not normally need to concern themselves with ClassIDs, since these are generally hidden from the user, however they are of concern to C++ COM developers who must typically reference and create their objects manually by ClassID.

The second type of Identifier is the ProgID, or programmatic ID. Every Visual Basic application has a project name (usually, or though not always, the same as the name of the executable). In addition, every class defined within a project also has a class name (again, usually, although not always, the same as the name of the code file containing the source code to the class). The ProgID of a Visual Basic Class is of the form:

ProjectName.ClassName

ProgIDs are not case sensitive, although it tends to be a convention to use proper case where possible.

Public COM classes created in languages other than Visual Basic will also have ProgIDs, although these are not necessarily of the direct ‘ProjectName.ClassName’ form as are those created by Visual Basic.