title: Convert String^ in c# to CString in c++/CLI
body: <p>I need a help on one question where I stuck while coding my app in <code>MFC</code>.</p>
  
  <p>I am using <code>CLR</code> i.e <code>Common Language Runtime</code> in my application to integrate c# APIs.
  but now I stuck on converting <code>System::String^</code> to <code>CString</code>.
  I am not able to do that.</p>
  
  <p>I am using Following code.</p>
  
  <pre><code>String^ csPass = gcnew String(strPassword.GetBuffer());
  array&lt;Byte&gt;^ Value = Encoding::UTF8-&gt;GetBytes(csPass);
  for (int i = 0; i &lt; Value-&gt;Length; i++ )
  {
  csPass += String::Format( "{0:X2}", Value[ i ] );
  }
  </code></pre>
  
  <p>now I want to convert <code>csPass</code> to <code>CString</code>.
  Can any one help me on this.
  Thank you in advance.</p>