title: Creating a KeyValuePair in Managed C++
body: <p>I have yet another managed C++ KeyValuePair question where I know what to do in C#, but am having a hard time translating to managed C++. Here is the code that does what I want to do in C#:</p>
  
  <pre><code>KeyValuePair&lt;String, String&gt; KVP = new KeyValuePair&lt;string, string&gt;("this", "that");
  </code></pre>
  
  <p>I've reflected it into MC++ and get this:</p>
  
  <pre><code>KeyValuePair&lt;String __gc*, String __gc*&gt; __gc* KVP = (S"this", S"that");
  </code></pre>
  
  <p>which I'm translating to:</p>
  
  <pre><code>KeyValuePair&lt;String ^, String ^&gt; KVP = (gcnew String("this"), gcnew String("that"));
  </code></pre>
  
  <p>I know from my <a href="https://stackoverflow.com/questions/341477/generic-generics-in-managed-c">previous question</a> that KeyValuePair is a value type; is the problem that it's a value type in C++ and a reference type in C#? Can anyone tell me how to set the key and value of a KeyValuePair from C++? </p>