title: How do I pass a LPCSTR to a c++ function convert to string and return a LPCSTR?
body: <p>I have a C++ API function that is called by Install Shield via InstallScript:</p>
  
  <pre><code>SQLHELPER_API LPCSTR GetAvailableAppName(LPCSTR appNameP)
  {
      //return "this works just fine";
      std::string newAppName = "I work, maybe?";
      LPCSTR returnVal = newAppName.c_str();
      return returnVal;
  }
  </code></pre>
  
  <p>The only thing that returns is an empty string. If I just return passed in variable "appNameP" it returns that just fine as well.</p>
  
  <p>My main issue is that I need to pass in a LPCSTR and perform some string operation on it.</p>