User`s guide

A Producing a COM Object from MATLAB
When a component is created, you can specify a version number (default =
1.0). During the develop ment of a specific v ersion of a component, the vers ion
number should be kept constant. When this is done, the MATLAB Compiler,
in certain cases, reuses type library, class, and interface GUIDs for each
subsequent build of the component. This avoids the creation o f an excessive
number of registry keys for the same component during multiple builds, as
occurs if new GUIDs are generated for each build.
Note When a new version number is introduced, the MATLAB Compiler
generatesnewclassandinterfaceGUIDs so that the system recognizes them
as distinct from previous versions, even if the class name is the same.
Therefore, once y ou d eplo y a built com p onent, use a new version number for
any changes made to the component. This ensures that after you deploy the
new component, it is easy to m anage the two versions.
The MATLAB Compiler implements the versioning rules for a specific
componen t name, class name, and version number by querying the system
registry for an e xisting component with the same name:
If an existing component has the same version, it uses the GUID of the
existing component’s type library. If the name of the new class matches the
previous version, it reuses the class and interface GUIDs. If the class names
do not match, it generates new GUIDs for the new class and interface.
If it finds an existing component with a different version, it uses the
existing type library GUID and creates a new subkey for the new version
number. It generates new GUIDs f or the new class a nd interface.
If it does not find an existing component of the specified name, it generates
new GUIDs for the component’s type library, class, and interface.
A-10