MOA Developer's Guide
MOA Interfaces | MOA Methods | MOA Types and Misc API

IMoaUnknown

Interface ID: IID_IMoaUnknown
Pointer type: PIMoaUnknown
Inheritance: none
Header file: moaxtra.h

Description

IMoaUnknown is the root interface for all MOA interfaces. All MOA objects and interfaces inherit the IMoaUnknown interface. This interface allows you to query any object--or any interface belonging to an object--for other interfaces of that object. IMoaUnknown also supports the reference counting mechanism used to track instances of MOA interfaces and to determine when they can be released from memory. MOA provides a default implementation of this interface, intended to be used by all MOA objects.

Methods

AddRef()
QueryInterface()
Release()

AddRef()

Syntax

AddRef()

Parameters

Returns

MoUlong updated value of the reference count for the interface

Description

Increments the reference count of an existing interface. Call this method when passing an existing interface to code that may need to retain the interface for itself. That code becomes responsible for calling Release() on the interface when it is through using it.

QueryInterface()

Syntax

QueryInterface(ConstIIDPtr pInterfaceID, void ** ppvObj)

Parameters

pInterfaceID
IID of interface being requested
ppvObj
Interface pointer of type being requested

Returns

MoaError

Description

Queries an interface to request another interface provided by the same object. Creates an instance of that interface (if none exists) and increments the reference count of the interface. Returns the result in ppvObj, a previously allocated pointer of the interface type being requested.

Release()

Syntax

Release()

Parameters

Returns

MoaUlong updated value of the reference count for the interface

Description

Decrements the reference count of the interface instance. Releases the instance if its reference count drops to zero.

Copyright © 1995-2008 Adobe Macromedia Software LLC, Inc.