title: Type library as a resource - What can cause LoadTypeLib to fail?
body: <p>I have created a type library for COM automation and want to embed it as a resource in my EXE file. I have added</p>
  
  <pre><code>1 TYPELIB "myfile.tlb"
  </code></pre>
  
  <p>to the RC file.</p>
  
  <p>However, calling <code>LoadTypeLib</code> for this EXE file fails with <code>TYPE_E_CANTLOADLIBRARY</code>. To verify whether the type library is actually in the EXE, I opened the EXE directly in Visual Studio and looked at its resources. Indeed, the type library is not shown. Does this really mean the type library is not there, or does it never show up in Visual Studio when opening the EXE directly?</p>
  
  <p><strong>Note:</strong> The type library is not (yet) registered; this is intentional. If my understanding is correct, then this shouldn't matter, since the path I pass to <code>LoadTypeLib</code> specifies the exact location of the EXE.</p>
  
  <p><strong>Update:</strong> Loading the type library works when I pass the full path of the TLB to <code>LoadTypeLib</code>. So it must have something to do with embedding the TLB as a resource in the EXE.</p>