VCOM:IVWSingletonUnknown

From Vectorworks Developer
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

.SDK|SDK ..SDK:Types|SDK Types ..VCOM:VCOM (Vectorworks Component Object Model)|VCOM Basics ..VCOM:Class Reference|VCOM Class Reference

What is this?

This interface gives singleton capability of an interface in VCOM:VCOM (VectorWorks Component Object Model).

// --------------------------------------------
// Base interface for single instance interfaces in VCOM
class IVWSingletonUnknown : public IVWUnknown
{
public:
};

The interface inherits VCOM:IVWUnknown and doesn't define any aditional functions. It's only purpose is to mark VCOM interfaces that have only one instance for the execution time of Vectorworks.

This means that if you query (SDK:GS_VWQueryInterface or VCOM:VCOMPtr) such an interface you will always get the same instance.

Note All rules for releasing apply. This is a type of VCOM interface.

Sample

// --------------------------------------
// {B5706042-BF87-4cff-9BD9-3A08B01C183C}
static const VWIID IID_VCOMSample = { 0xb5706042, 0xbf87, 0x4cff, { 0x9b, 0xd9, 0x3a, 0x8, 0xb0, 0x1c, 0x18, 0x3c } };
 
class IVCOMSample : public IVWSingletonUnknown 
{
public:
    virtual VCOMError VCOM_CALLTYPE Function() = 0;
};

void fun()
{
    VCOMPtr<IVCOMSample> p1( IID_VCOMSample );
    VCOMPtr<IVCOMSample> p2( IID_VCOMSample );

    // since IVCOMSample is singleton
    // the two instances will be the same (sample pointers: p1 == p2)
}

See Also

VCOM:IVWUnknown