-
May 4th, 2016, 02:42 PM
#1
Re: Strings in VC Form buttons
Experienced Boreland C programmer moving to VC - it's about time!
So I dragged over a data structure from a DOS application, included it in the *c++ file and the it compiles.
Now I want to use that structure to place the text in from buttons.
where:
Code:
this->button2->Text = L"button2";
I am modifying as follows:
Code:
this->button2->Text = src_lev[1].src_name1;
and I get an error!
structure file snippit. This is a proven good Boreland C file.
Code:
#define XPF 9999
struct src_list {
char *src_name1;
char *src_name2;
int src_num[11];
} src_lev[] ={
/* src top row bot row PAN HDa HDb SD REF LTC CNTL A12 A34 A56 A78 */
/* 0 */ "", "", XPF, XPF, XPF, XPF, XPF, XPF, XPF, XPF, XPF, XPF, XPF,
/* 1 */ "ResMac-1", "", 1, 5102, 5103, XPF, 193, XPF, XPF, 5104, 5106, 5108, 5110,
/* 2 */ "ResMac-2", "", 2, 5115, 5116, XPF, 194, XPF, XPF, 5117, 5119, 5121, 5123,
rest of structure not shown
Last edited by adelle; May 4th, 2016 at 04:00 PM.
-
May 5th, 2016, 04:13 AM
#2
Re: Strings in VC Form buttons
Originally Posted by adelle
Experienced Boreland C programmer moving to VC - it's about time!
So I dragged over a data structure from a DOS application, included it in the *c++ file and the it compiles.
Now I want to use that structure to place the text in from buttons.
where:
Code:
this->button2->Text = L"button2";
I am modifying as follows:
Code:
this->button2->Text = src_lev[1].src_name1;
and I get an error!
What error do you get?
Victor Nijegorodov
-
May 5th, 2016, 11:45 AM
#3
Re: Strings in VC Form buttons
Originally Posted by VictorN
What error do you get?
this one
1>c:\documents and settings\dellea\my documents\visual studio 2010\projects\resolve panel switcher\resolve panel switcher\Form1.h(563): error C2664: 'void System::Windows::Forms::Control::Text::set(System::String ^)' : cannot convert parameter 1 from 'char *' to 'System::String ^'
1> No user-defined-conversion operator available, or
1> Cannot convert an unmanaged type to a managed type
-
May 5th, 2016, 12:19 PM
#4
Re: Strings in VC Form buttons
Well, I guess you are not the first person getting this error message: https://www.google.de/search?q=C2664...hrome&ie=UTF-8
Victor Nijegorodov
-
May 5th, 2016, 12:51 PM
#5
Re: Strings in VC Form buttons
Thank You. That advice fix it.
Code:
this->button1->Text = gcnew String(src_lev[1].src_name1);
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
|