Basic COM   «Prev  Next»

Accessing COM Objects - Quiz

Each question is worth one point. Select the best answer or answers for each question.
 

1. How often do clients call CoInitialize and CoUninitialize?
Please select the best answer.
  A. Once per process
  B. Once per function
  C. Once per thread

2. To get a class factory from an in-process server clients, call:
Please select the best answer.
  A. CoGetClassObject, passing in the COM object's CLSID, CLSCTX_INPROC_SERVER, and IID_IClassFactory
  B. CoGetClassObject, passing in the class factory's CLSID, CLSCTX_INPROC_SERVER, and IID_IUnknown
  C. CoCreateInstance, passing in the COM object's CLSID, CLSCTX_INPROC_SERVER, and IID_IClassFactory

3. To create an instance of a COM object clients:
Please select all the correct answers.
  A. Call IClassFactory::CreateInstance, passing in an IID implemented by the object
  B. Call CoCreateInstance, passing in the object's CLSID and an IID implemented by the object
  C. Call COM API function GetCOMObject, passing in the object's CLSID and an IID implemented by the object

4. When finished using a class factory, a client should:
Please select the best answer.
  A. Call CoUninitialize()
  B. Set the IClassFactory pointer to NULL
  C. Call IClassFactory::Release