title: How to fix Loading a DLL
body: <p>dll is not loading, i am suspecting there is a problem with the typecasting.</p>
  
  <p>I typecasted to LPCWSTR, but it is failing while loading, if am giving the path directly its loading that is working fine. But its not taking strFile path.</p>
  
  <pre><code>HINSTANCE initH2oLibFilename(LPCSTR strFile, std::ostream&amp; os)
  {
  
  HINSTANCE lib = LoadLibrary((LPCWSTR)strFile);
      if(!lib)
      {
          os &lt;&lt; "Error loading \'" &lt;&lt; strFile &lt;&lt;'\''&lt;&lt; std::endl;
          return NULL;
      }
  }
  
  
  HINSTANCE initH2oLibIF97(LPCSTR strPath, std::ostream&amp; os)
  {
  
      std::string strFile(strPath);
      strFile += "H2O32Bit.dll";
      return initH2oLibFilename(strFile.c_str(), os);
  }
  </code></pre>