Carapace

Apartment Class

COM uses the idea of an apartment thread to describe a thread which handles access to its contained COM components. This is exactly what the Carapace Apartment object does -- it is a thread which supports a set of classes declared in a given type library.

Apartment Creation

An Apartment is created by using the create function eg.

    (create Apartment)
At this point, the apartment thread does not know what COM classes to support. These are installed using the loadTypeLibrary method.

Apartment Properties

None.

Apartment Methods

method name description
loadTypeLibrary load the type library and offer its classes to COM


loadTypeLibrary

Load the type library having the supplied GUID and offer its classes to COM. COM can then use this apartment thread to create COM servers for the types contained in the type library.

NOTE:

Arguments:

typeLibGuidString
registrationContextInteger

The registrationContext is formed by adding the following integers together:

inproc server1
inproc handler2
local server4
remote server16

Return type: the empty List is returned


Contents Index Current topic: COM Related Links: COM helpers, objects, built-in objects