title: Error on Visual C++ Forms, Simple MessageBox and assign text from textfield to string
body: <pre><code>private: System::Void btn_entrar_Click(System::Object^  sender, System::EventArgs^  e) {
  
  string btn_texto = txt_login-&gt;Text-&gt;ToString();
  MessageBox(NULL, "Hello!", btn_texto.c_str(), MB_OK | MB_ICONEXCLAMATION);
  
  }
  </code></pre>
  
  <p>I'm creating a windows forms application normally in Visual C++ Studio 2008 Professional, I added a click function (by double clicking in the button on the design mode) so I wrote the code inside the function it generated.</p>
  
  <p>it generated 2 errors:</p>
  
  <p>Error 1: </p>
  
  <blockquote>
    <p>error C2440: 'initializing' : cannot convert from 'System::String ^'
    to 'std::basic_string&lt;_Elem,_Traits,_Ax>'</p>
  </blockquote>
  
  <p>Error 2:</p>
  
  <blockquote>
    <p>error C2872: 'MessageBox' : ambiguous symbol 1>        could be
    'C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winuser.h(7374)
    : int MessageBox(HWND,LPCTSTR,LPCTSTR,UINT)' 1>        or<br>
    'c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll
    : System::Windows::Forms::MessageBox'</p>
  </blockquote>
  
  <p>I'm creating in C++ on Visual Studio 2008 Professional at Windows 7  and the project under .NET Framework 3.5</p>
  
  <p>Someone know how do I fix this? I looked it up all over but couldn't find a solution.
  I hope I gave enough information.
  Thanks in advance.</p>
  
  <p><strong>@edit Example Given by Cody Gray</strong></p>
  
  <pre><code>System::String btn_texto = txt_login-&gt;Text-&gt;ToString();
  System::Windows::Forms::MessageBox(NULL, "Hello!", "HI", MB_OK | MB_ICONEXCLAMATION);
  </code></pre>
  
  <p>Errors Gotten</p>
  
  <blockquote>
    <p>error C3149: 'System::String' : cannot use this type here without a
    top-level '^' error C2661:
    'System::Windows::Forms::MessageBox::MessageBox' : no overloaded
    function takes 4 arguments</p>
  </blockquote>
  
  <p>So I solved the first error by adding ^ after System::String
  being like this:</p>
  
  <blockquote>
    <p>System::String^ btn_texto = txt_login->Text->ToString();</p>
  </blockquote>
  
  <p>but the second error wasn't fixed, and by the way, how would I add the "btn_texto" content in the MessageBox Function? Thanks!</p>