comstl/util/object_functions.h File Reference


Detailed Description

[C, C++] Definition of several interface and identity functions (COM Utility Library).

#include <comstl/comstl.h>

Go to the source code of this file.

Namespaces

namespace  comstl

Functions

STLSOFT_INLINE HRESULT comstl__get_object_identity (LPUNKNOWN p, LPUNKNOWN *identity)
 [C only] Evaluates an object's identity
STLSOFT_INLINE HRESULT comstl__is_same_object (LPUNKNOWN p1, LPUNKNOWN p2)
 [C only] Determines whether two interfaces refer to the same object
STLSOFT_INLINE HRESULT comstl__is_interface_implemented (LPUNKNOWN p, REFIID riid)
 [C only] Determines whether an object implements a given interface without adding a reference count
HRESULT get_object_identity (LPUNKNOWN p, LPUNKNOWN *identity)
 Evaluates an object's identity.
HRESULT is_same_object (LPUNKNOWN p1, LPUNKNOWN p2)
 Determines whether two interfaces refer to the same object.
HRESULT is_interface_implemented (LPUNKNOWN p, REFIID riid)
 Determines whether an object implements a given interface without adding a reference count.


Function Documentation

STLSOFT_INLINE HRESULT comstl__get_object_identity ( LPUNKNOWN  p,
LPUNKNOWN *  identity 
)

[C only] Evaluates an object's identity

Parameters:
p The pointer to the object whose identity will be evaluated
identity 
Returns:
A status code indicating whether the identity was retrieved
Return values:
S_OK The pointers refer to the same object
E_POINTER If p is null
E_INVALIDARG If identity is null
any-other-code Indicates an error from the call to QueryInterface()
Precondition:
p is a NULL pointer, or a valid pointer to a COM interface.
Remarks:
If the function success, the caller must release the reference count associated with the interface pointer in *identity.
Note:
Intended for use in C-compilation units only. For C++, use comstl::get_object_identity().

References COMSTL_IID_2_REF, COMSTL_ITF_CALL, COMSTL_ITF_THIS, and stlsoft_reinterpret_cast.

Referenced by comstl::get_object_identity().

STLSOFT_INLINE HRESULT comstl__is_interface_implemented ( LPUNKNOWN  p,
REFIID  riid 
)

[C only] Determines whether an object implements a given interface without adding a reference count

Returns:
A status code indicating whether the given interface is implemented
Return values:
S_OK The interface is implemented and accessible
E_NOINTERFACE The interface is not implemented
any-other-code Indicates an error from the call to QueryInterface()
Precondition:
p is a non-NULL pointer to a COM interface.

References COMSTL_ITF_CALL, COMSTL_ITF_THIS, COMSTL_ITF_THIS0, COMSTL_MESSAGE_ASSERT, and stlsoft_reinterpret_cast.

Referenced by comstl::is_interface_implemented().

STLSOFT_INLINE HRESULT comstl__is_same_object ( LPUNKNOWN  p1,
LPUNKNOWN  p2 
)

[C only] Determines whether two interfaces refer to the same object

Returns:
A status code indicating whether the two pointers refer to the same object
Return values:
S_OK The pointers refer to the same object
S_FALSE The pointers refer to different objects
E_POINTER If either/both pointers are null
any-other-code Indicates an error from one of the calls to QueryInterface()
Precondition:
p1 and p2 are NULL pointers, or are valid pointers to COM interfaces.

References COMSTL_IID_2_REF, COMSTL_ITF_CALL, COMSTL_ITF_THIS, COMSTL_ITF_THIS0, and stlsoft_reinterpret_cast.

Referenced by comstl__VARIANT_equal(), and comstl::is_same_object().


Generated on Thu Jun 10 08:57:57 2010 for STLSoft by  doxygen 1.5.6