title: How to use CoCreateInstance() to get a com object?
body: <p>I had registered a COM component.And I want to call it.</p>
  
  <pre><code>CLSID clsid;
  RIID iid;
  HRESULT hr = CLSIDFromProgID(OLESTR("se.mysoft"),&amp;clsid);
  LPVOID *pRet;
  HRESULT hr1 = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER, iid, pRet);
  </code></pre>
  
  <p>I can get the clsid successful, but where can I get the iid ? </p>
  
  <p>I used OLE VIEWER find interface:</p>
  
  <pre><code> [
   odl,
   uuid(F3F54BC2-D6D1-4A85-B943-16287ECEA64C),
   helpstring("Isesoft Interface"),
   dual,
   oleautomation
   ]
   interface Isesoft : IDispatch {
  </code></pre>
  
  <p>Then I changed my code:</p>
  
  <pre><code>CLSID clsid;
  RIID iid;
  IDispatch* pDispatch;
  HRESULT hr = CLSIDFromProgID(OLESTR("se.mysoft"),&amp;clsid);
  HRESULT hr1 = CoCreateInstance(clsid, NULL, CLSCTX_INPROC_SERVER,  IID_IDispatch,(void **)&amp;pDispatch);
  </code></pre>
  
  <p>But hr1 returned failed.</p>