title: Only partial access to a COM Type Library through Python
body: <p>I am attempting to write some scripts to employ a COM type library that came with an application to control it externally.</p>
  
  <p>However, I am stuck in my use of the Python libraries for COM (pythoncom and win32com):</p>
  
  <p>Using a COM Browser, I am able to navigate to find the GUID for the Type Library I am interested in using.</p>
  
  <p>Using pythoncom, I am able to easily navigate this type library to see what objects are available available.</p>
  
  <pre><code>&gt;&gt;&gt; import win32com.client
  &gt;&gt;&gt; import pythoncom
  &gt;&gt;&gt; type_lib_iid = '{12345678-ABCD-EFGH-1234-12341234}'
  &gt;&gt;&gt; lib = pythoncom.LoadTypeLib(type_lib_iid, 1, 0)
  &gt;&gt;&gt; for index in range(0, lib.GetTypeInfoCount()):
          print lib.GetDocumentation(index)[0]
          print lib.GetTypeInfo(index).GetTypeAttr().iid
  </code></pre>
  
  <p>This returns all the GUID's of the available COM objects (sorry if I am butchering this vocabulary).</p>
  
  <p>Strangely, while all the objects that are returned by this call appear in the COM browser when I browse the type library, only 4 of the 81 that are available can I call Dispatch on.  The rest return:</p>
  
  <pre><code>'Class not registered.'
  </code></pre>
  
  <p>My question is in two parts: </p>
  
  <p>1) How is it possible that objects can be found both through a COM browser and through the above call and not be callable using win32com.client.Dispatch?  [Note: the application in question IS running.]</p>
  
  <p>2) Am I using the wrong function?  Is Dispatch incorrect? I freely admit that I have found the documentation for the Python COM modules confusing, but I have not found any examples where existing COM objects were not Dispatched upon, so I do not know where to go from here.  Furthermore, the 4 objects that CAN be dispatched upon seem to work exactly as explained in the documentation.</p>
  
  <p>[One last note: if I attempt pythoncom.CoCreateInstance(TypeLibCLSID, None, 1, GUIDofInterfaceObject) I get 'Interface not supported." The critical interface I need to use is the GUID I am trying here.]</p>