title: Passing a List<String^> from c++ to C#
body: <p>Not that experienced with c++, so requesting some help here.
  What I got is a .net dll and I'm writing a wrapper, so that the .net dll can be used later in c++ and vb6 projects.</p>
  
  <p>My code so far:</p>
  
  <p>c# class I want to call:</p>
  
  <pre><code>public class App
  {
     public App(int programKey, List&lt;string&gt; filePaths)
     {
         //Do something
     }
  }
  </code></pre>
  
  <p>my c++ project:</p>
  
  <pre><code>static int m_programKey;
  static vector&lt;std::string&gt; m_fileNames;
  
  void __stdcall TicketReportAPI::TrStart(int iProgramKey)
  {
      m_programKey = iProgramKey;
  };
  
  void __stdcall TicketReportAPI::TrAddFile(const char* cFileName)
  {
      string filename(cFileName);
      m_fileNames.push_back(filename);
  }
  
  
  void __stdcall TicketReportAPI::TrOpenDialog()
  {
  
      if(m_fileNames.size()&gt; 0)
      {
  
          List&lt;String^&gt; list = gcnew List&lt;String^&gt;();
  
          for(int index = 0; index &lt; m_fileNames.size(); index++)
          {
  
              std::string Model(m_fileNames[index]);
              String^ sharpString = gcnew String(Model.c_str());
  
              list.Add(gcnew String(sharpString));
          }
  
  
          App^ app = gcnew App(m_programKey, list);
  
      }
      else
          App^ app = gcnew App(m_programKey);
  
  }
  </code></pre>
  
  <p>If I'm trying to compile the c++ project I get following error:</p>
  
  <p><strong>App(int,System::Collections::Generic::List ^)': Conversion from 'System::Collections::Generic::List' to 'System::Collections::Generic::List ^' not possible</strong></p>
  
  <p>Is it possible to pass a managed List from c++ to .net c#?
  If not, what do you guys suggest me to pass a string array to my c# assembly?</p>
  
  <p>Every help is appreciated, Thanks in advance.</p>