-
April 28th, 2011, 10:09 AM
#1
please hep textBox1->Text = s;
string s;
s = "kamil";
textBox1->Text = s;
and I have an error message
1>Dizi.cpp
1>c:\vc\dizi\dizi\Form1.h(112) : error C2664: 'void System::Windows::Forms::Control::Text::set(System::String ^)' : cannot convert parameter 1 from 'std::string' to 'System::String ^'
1> No user-defined-conversion operator available, or
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>Build log was saved at "file://c:\VC\Dizi\Dizi\Release\BuildLog.htm"
1>Dizi - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
please help me?
-
April 28th, 2011, 10:10 AM
#2
Re: please hep textBox1->Text = s;
Your code is managed C++, not native C++. Try posting your question here.
-
April 28th, 2011, 11:09 AM
#3
Re: please hep textBox1->Text = s;
First, take a look at this discussion: http://www.codeguru.com/forum/showthread.php?t=511412
[ Moved thread ]
-
April 28th, 2011, 11:53 AM
#4
Re: please hep textBox1->Text = s;
-
April 28th, 2011, 02:31 PM
#5
Re: please hep textBox1->Text = s;
I solved problem. Thanks for all;
mktArray < char * > * le = new mktArray < char * >;
le->Add("kamil");
le->Add("turan");
le->Add("safranbolu");
String ^ s = gcnew String(le->Get(0));
textBox1->Text = s;
delete le;
I can convert char * to string that use String ^ s = gcnew String.
-
April 29th, 2011, 02:52 AM
#6
Re: please hep textBox1->Text = s;
Originally Posted by mkamilturan
string s;
s = "kamil";
textBox1->Text = s;
The simplest way:
Code:
String^ txt = "Kamil";
textBox1->Text = txt;
Cheers
Last edited by smallbit; April 29th, 2011 at 02:54 AM.
-
May 10th, 2011, 10:34 AM
#7
Re: please hep textBox1->Text = s;
im pretty sure that all you have to do is:
this->textBox1->Tekst = s;
Last edited by Dutchman; May 10th, 2011 at 10:38 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|