I need to get the contents of a standard old fashion text string into a dialog textbox. Here is a code example from Form1.h...
...
public
:Form1(
void){
char test[132];InitializeComponent();
// //TODO: Add the constructor code here //strcpy(test,someglobalstring
);FileInText->Text = test;
//This gives a compiler error, How do I make it work//FileInText is the textbox...
FileInText->Text =
"This is a test"; //This works fine}

Getting the contents of a standard old fashion text string into a dialog textbox.
pbergeron
Maybe it's my complete lack of understanding of C++ (I'm just an old time C programmer), but this still gave me a compiler error...
error C2664: 'void System::Windows::Forms::Control::Text::set(System::String ^)' : cannot convert parameter 1 from 'System::String' to 'System::String ^'
No user-defined-conversion operator available, or
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
If I add the... User System::String:
I get a different error for it...
error C2065: 'User' : undeclared identifier
Manfred Mejias
So this should work, even if I didn't try it.
FileInText->Text = gcnew System::String(test);
If you look at the compiler message you can see it by your own. There was only no converstion from System::String to System::String ^
shreeman
char test[132];
strcpy(test, something);
FileInText->Text = System::String(test);