ProgID-s and ClassID-s
VaryDisp object is the manager object for the actual composite
object. Through its members the application can add objects to the
composite, expose their members through it (under specified names
and DISPIDs) etc. When created VaryDisp automatically creates an
"empty" composite and prepares it for management.
So the VaryDisp object is responsible for dynamic composite
construction. Predefined composite objects can be created
through the VaryDispCreator
object or using the typical COM object creation techniques if the
composite is registered with the system. Furthermore
VaryDispCreator allows the application to create a predefined
composite and obtain the VaryDisp (manager object) for it instead
of the object itself. This would be useful for applications that
need to modify the created object - e.g. the object has some
base/initial features but the application will want extend them
dynamically.
COM notes (important for pure autorun applications)
There is no strictly defined requirement for the composite
objects but their functionality depends on the objects used to
create them. Therefore it is important to create them under
conditions where all of their components will work properly. So if
the objects used in a composite require single-threaded apartment
the composite should be created in such an COM apartment. As the
newobjectspack1.dll registers composite related classes as
apartment this requirement will be automatically met if the DLL is
installed. However you will need to take care about the COM
conditions yourself if you use the DLL in non-installed mode - for
example from a pure autorun ALP application. In such case the best
way to guarantee the composite will be created in a
single-threaded COM apartment is to use the COMApartment
object and create the composite there.
|