title: return string from c++ function to VB .Net
body: <p>I am trying to call C++ function from VB.Net code which returns string using P/Invoke, but it is returning only single character.</p>
  
  <p><strong>C function Declaration</strong></p>
  
  <pre><code>  extern "C" __declspec(dllexport) LPSTR Get_GetDescription(HANDLE)
  </code></pre>
  
  <p><strong>C function Definition</strong></p>
  
  <pre><code>  LPSTR Get_GetDescription(HANDLE resultBreakDown){
      return LPSTR(((CalcBreakDown*)resultBreakDown)-&gt;GetDescription().c_str()); 
  }
  </code></pre>
  
  <p><strong>VB.Net Code</strong></p>
  
  <pre><code>    &lt;DllImport("FeeEngineDll.dll", CallingConvention:=CallingConvention.Cdecl)&gt; _
      Public Shared Function Get_GetDescription(ByVal resultBreakDown As IntPtr, ByVal indexSubs As Integer, ByVal indexLine As Integer) As &lt;MarshalAsAttribute(LPStr)&gt; String
      End Function
  </code></pre>
  
  <p>Is there any problem with return type or Marshalling?</p>