Freshers Aptitude technical questions
Freshers Job Alert
Bookmark and Share

Basic COM Interfaces and Details

 

The IUnknown interface lets clients get pointers to other interfaces on a given object through the QueryInterface method, and manage the existence of the object through the IUnknown::AddRef and IUnknown::Release methods. All other COM interfaces are inherited, directly or indirectly, from IUnknown . Therefore, the three methods in IUnknown are the first entries in the VTable for every interface.

Methods in Vtable Order

IUnknown Methods

Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments reference count.

Release

Decrements reference count.

 

The IDispatch interface was initially designed to support Automation. It provides a late-binding mechanism to access and retrieve information about an object's methods and properties.

  • GetTypeInfoCount —returns the number of type descriptions for the object. For objects that support IDispatch , the type information count is always one.
  • GetTypeInfo —retrieves a description of the object's programmable interface.
  • GetIDsOfNames —maps the name of a method or property to a DISPID, which is later used to invoke the method or property.
  • Invoke —calls one of the object's methods, or gets or sets one of its properties.