Component Object Model basics - Quiz Results

The answers you selected are indicated below, along with text that explains the correct answers.
 
1. What is a COM interface?
Please select the best answer.
  A. A group of related methods
  B. A fancy name for a C++ object
  C. A serial access mechanism to support persistence data
  The correct answer is A. An interface groups and defines a set of COM methods.

2. What is a requirement for all COM interfaces?
Please select the best answer.
  A. They must be written in C++
  B. They are required to allow access from Java
  C. They are required to implement methods to support interface navigation and lifetime management
  The correct answer is C. The COM specification requires methods to support interface navigation and lifetime management.

3. Which of the following does a COM object contain or implement?
Please select the best answer.
  A. The CreateCOMObject method to create instances of itself
  B. The IClassFactory interface to create instances of itself
  C. One or more COM interfaces
  The correct answer is C. A COM object contains one or more interfaces.

4. What is a COM server?
Please select the best answer.
  A. A DLL or EXE that contains one or more COM objects
  B. A virtual device driver installed in the COM subsystem
  C. A DLL that supports the CreateCOMObject method to create COM objects
  The correct answer is A. A COM server is implemented within a DLL or EXE; it contains/implements one or more COM objects

5. Who creates a COM object?
Please select the best answer.
  A. A client calling the CreateCOMObject library function
  B. By a class object that is normally a class factory
  C. By IUnknown
  The correct answer is B. COM objects are created by class objects. Most class objects are class factories.

6. When are COM objects normally created?
Please select the best answer.
  A. When a client asks COM for a class factory associated with a COM object. Using the class factory, clients create instances of COM objects.
  B. COM precreates all COM objects, caching them until a client request comes in.
  C. When a user clicks a control, invoking inside-out activation.
  The correct answer is A. Clients get a class factory associated with a specific type of COM object. Using the class factory, clients create one or more instances of the COM object.

7. How do clients access COM objects?
Please select the best answer.
  A. Through public data members because the object is usually implemented in C++
  B. Through the servers' implementation of Invoke
  C. Through the object's interfaces
  The correct answer is C. COM supports calling interface methods only within a COM object. It is not possible to access an object's data directly.