Carapace

Unknown Class

The Unknown class contains the IUnknown. Every COM interface is required to support IUnknown.

Within Carapace, access to a COM object is via the dispatch interface. If a COM object does not support such an interface, you can still hold a reference to it within Carapace and pass it to other functions by using this Unknown class.

Unknown Creation

If a COM method returns an object reference which does not support a dispatch interface, then you will receive it in Carapace as an Unknown object.

You can create an empty Unknown object by using the create function eg.

    (create Unknown)
If you already have a Dispatch object and you want its IUnknown reference, then use the create function as in the following example:
    (global (::browser Dispatch) (::unk Unknown) )
    (set ::browser (create Dispatch "InternetExplorer.Application"))

    (set ::unk (create Unknown ::browser))

Unknown Properties

None.

Unknown Methods

method name description
dispatch attempt to get a dispatch interface from the object, if it supports one
enumerator attempt to get an enumerator interface from the object, if it supports one
isNull test if the contained IUnknown reference is the null pointer
supports test if the contained COM object supports the interface identified by the supplied GUID
container attempt to get a dispatch interface onto the OLE container -- assuming the contained COM object represents an OLE container


dispatch

Attempt to get a dispatch interface from the object, if it supports one.

If a interface id is supplied, the contained object is first queried for that interface, and then for the dispatch interface. In this way you can request a particular dispatch interface from the object if it supports multiple dispatch interfaces.

Arguments:

iid (optional)Guid

Return type: a Dispatch object or, if none exists the empty list () is returned.


enumerator

Attempt to get an enumerator interface from the object, if it supports one.

This queries the contained object to see if it supports IEnumVARIANT and , if so, returns it as a Carapace Enumerator object.

Arguments: none

Return type: a Enumerator object or, if none exists the empty list () is returned.


isNull

Test if the contained IUnknown reference is the null pointer.

Arguments: none

Return type: if the contained pointer is null, then the Symbol true is returned, otherwise the empty list () is returned.


supports

Test if the contained COM object supports the interface identified by the supplied GUID.

Arguments:

iidGuid

Return type: if the interface is supported, then the Symbol true is returned, otherwise the empty list () is returned.


container

Attempt to get a dispatch interface onto the OLE container -- assuming the contained COM object represents an OLE container. If no container is available, or the container does not a dispatch interface, then an error is raised.

This is useful if you are using a Carapace object embedded within an OLE container such as a browser, since it gives you a way to invoke methods on the container.

Arguments: none

Return type: Dispatch


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