title: how to use C++ load a COM server written in C#?
body: <p>I am trying to use a COM server generated by Visual Studio 2010 .
  When I run CreateInstance(..) , I get error code 0x80040154 . 
  I enabled fusion log  and ran fuslogvw . Fuslogvw reported that loading of assembly (by unknown caller assembly)</p>
  
  <pre><code>mscorlib.resources, Version=4.0.0.0, Culture=zh-HK, PublicKeyToken=b77a5c561934e089
  </code></pre>
  
  <p>I have already installed .net framework 4 language pack for traditional chinese and also simplified chinese . </p>
  
  <p>Please help . Thanks in advance.</p>
  
  <p>My c++ code is as follow:</p>
  
  <pre><code>#include "stdafx.h"
  #import "/Project/TestCOM/MyProject.tlb"
  #include &lt;comutil.h&gt;
  
  int _tmain(int argc, _TCHAR* argv[])
  {
      CoInitialize(NULL);
  
      MyProject::_PHPStarterPtr pCalc;
  
      HRESULT hRes = pCalc.CreateInstance(__uuidof(MyProject::PHPStarter));
      if(FAILED(hRes)) 
      {
          printf("MyProject::_PHPStarterPtr failed w/err 0x%08lx\n", hRes); // it printed MyProject::_PHPStarterPtr failed w/err 0x80040154
      }
      else
      {
          pCalc-&gt;AddRef();
  
          bstr_t s("hello");
          bstr_t outStr = pCalc-&gt;Echo(s);
          printf("outStr = %s\n", (const char *)outStr);
  
          pCalc-&gt;Release();
          printf("Dispose() done\n");
      }
  
      CoUninitialize();
      return 0;
  }
  </code></pre>